Get New Package Versions #280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Get New Package Versions | |
| # needed for creating PRs | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| jobs: | |
| # first job will run a script to get a list of packages to update | |
| check-for-updates: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| updates: ${{ steps.run-script.outputs.updates }} | |
| steps: | |
| - name: log start | |
| run: echo "Workflow get_new_package_versions started at $(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
| - name: checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: setup python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: '3.14' | |
| - name: install python deps | |
| run: pip install --require-hashes -r hack/requirements.txt | |
| - name: run the check-package-updates script | |
| id: run-script | |
| env: | |
| SERVICE_ACCOUNT_PASSWORD: ${{ secrets.SERVICE_ACCOUNT_PASSWORD }} | |
| SERVICE_ACCOUNT_USERNAME: ${{ secrets.SERVICE_ACCOUNT_USERNAME }} | |
| run: ./hack/check-for-updates.py >> "$GITHUB_OUTPUT" | |
| create-prs: | |
| runs-on: ubuntu-latest | |
| needs: check-for-updates | |
| if: ${{ needs.check-for-updates.outputs.updates != '[]' }} | |
| strategy: | |
| matrix: | |
| update: ${{ fromJSON(needs.check-for-updates.outputs.updates) }} | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: update the package version | |
| env: | |
| update: ${{ matrix.update }} | |
| run: ./hack/replace-package "$update" | |
| - name: create PR | |
| id: create-pr | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8 | |
| with: | |
| add-paths: onboarded_packages/ | |
| commit-message: Automatic build ${{ matrix.update }} | |
| title: Automatic build ${{ matrix.update }} | |
| branch: update-${{ matrix.update }} | |
| delete-branch: true | |
| base: main | |
| labels: | | |
| automated build | |
| log-end: | |
| runs-on: ubuntu-latest | |
| needs: [check-for-updates, create-prs] | |
| if: always() | |
| steps: | |
| - name: log end | |
| run: echo "Workflow get_new_package_versions ended at $(date -u +'%Y-%m-%dT%H:%M:%SZ')" |