Update dependencies #17
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 dependencies | |
| on: | |
| schedule: | |
| - cron: "00 17 * * FRI" # Every Friday at 17:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: write | |
| defaults: | |
| run: | |
| shell: bash -euo pipefail {0} | |
| jobs: | |
| update-dependencies: | |
| name: Update dependencies | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Generate Auto-Merge GitHub App Token | |
| id: generate-automerge-token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ secrets.AUTOMERGE_APP_ID }} | |
| private-key: ${{ secrets.AUTOMERGE_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ github.event.repository.name }} | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Run cargo update | |
| id: update | |
| run: | | |
| cargo update 2> >(tee /dev/stderr) | ./scripts/cargo-update-filter.sh > /tmp/cargo-update.log | |
| echo "log=$(jq -Rs . < /tmp/cargo-update.log)" >> ${GITHUB_OUTPUT} | |
| echo "table=$(./scripts/cargo-update-to-table.sh < /tmp/cargo-update.log | jq -Rs .)" >> ${GITHUB_OUTPUT} | |
| - name: Create pull request | |
| id: create-pr | |
| uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| commit-message: | | |
| build(deps): update dependencies | |
| ${{ fromJSON(steps.update.outputs.log) }} | |
| branch: update-${{ github.run_number }}-${{ github.run_id }} | |
| title: "build(deps): update dependencies" | |
| body: | | |
| Updates dependencies to latest versions per Cargo.toml constraints. | |
| ${{ fromJSON(steps.update.outputs.table) }} | |
| author: "missionis[bot] <234988995+missionis[bot]@users.noreply.github.com>" | |
| committer: "missionis[bot] <234988995+missionis[bot]@users.noreply.github.com>" | |
| labels: | | |
| dependencies | |
| rust | |
| delete-branch: true | |
| - name: Enable auto-merge | |
| id: enable-auto-merge | |
| if: steps.create-pr.outputs.pull-request-number | |
| run: | | |
| gh pr merge --auto -ds ${{ steps.create-pr.outputs.pull-request-number }} | |
| env: | |
| GH_TOKEN: ${{ steps.generate-automerge-token.outputs.token }} |