Update known checksums #199
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: "Update known checksums" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 4 * * *" # Run every day at 4am UTC | |
| repository_dispatch: | |
| types: [ pypi_release ] | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: true | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Update known checksums | |
| id: update-known-checksums | |
| run: | |
| node dist/update-known-checksums/index.cjs | |
| src/download/checksum/known-checksums.ts | |
| - name: Check for changes | |
| id: changes-exist | |
| run: | | |
| git status --porcelain | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "changes-exist=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changes-exist=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Compile changes | |
| if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }} | |
| run: npm ci --ignore-scripts && npm run all | |
| - name: Commit and push changes | |
| if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }} | |
| id: commit-and-push | |
| continue-on-error: true | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: update known checksums for $LATEST_VERSION" | |
| git push origin HEAD:refs/heads/main | |
| env: | |
| LATEST_VERSION: ${{ steps.update-known-checksums.outputs.latest-version }} | |
| - name: Create Pull Request | |
| if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }} | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| commit-message: "chore: update known checksums" | |
| title: | |
| "chore: update known checksums for ${{ | |
| steps.update-known-checksums.outputs.latest-version }}" | |
| body: | |
| "chore: update known checksums for ${{ | |
| steps.update-known-checksums.outputs.latest-version }}" | |
| base: main | |
| labels: "automated-pr,update-known-checksums" | |
| branch: update-known-checksums-pr | |
| delete-branch: true |