Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
quinna-h committed Sep 3, 2024
1 parent 733a80e commit 01719b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/generate-package-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,21 @@ jobs:
- name: Run regenerate-riot-latest
run: scripts/regenerate-riot-latest.sh

- name: Get latest version
id: new-latest
run: |
NEW_LATEST=$(python scripts/get_latest_version.py ${{ env.VENV_NAME }})
echo "NEW_LATEST=$NEW_LATEST" >> $GITHUB_ENV
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "upgrade-latest-${{ env.VENV_NAME }}-version"
commit-message: "Test Package Versions update"
commit-message: "Update package version"
delete-branch: true
base: main
title: "chore: update ${{ env.VENV_NAME }} latest version"
title: "chore: update ${{ env.VENV_NAME }} latest version to ${{ env.NEW_LATEST }}"
labels: changelog/no-changelog
body-path: .github/PULL_REQUEST_TEMPLATE.md
14 changes: 14 additions & 0 deletions scripts/get_latest_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys

import requests


def get_latest_version(package_name):
response = requests.get(f"https://pypi.org/pypi/{package_name}/json")
data = response.json()
return data["info"]["version"]


package_name = sys.argv[1]
latest_version = get_latest_version(package_name)
print(f"{latest_version}")

0 comments on commit 01719b5

Please sign in to comment.