diff --git a/.github/workflows/update-rust-toolchain.yml b/.github/workflows/update-rust-toolchain.yml index 83596f6..7476211 100644 --- a/.github/workflows/update-rust-toolchain.yml +++ b/.github/workflows/update-rust-toolchain.yml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - pull-requests: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -40,17 +39,25 @@ jobs: if: steps.check.outputs.needs_update == 'true' run: sed -i 's/^channel = ".*"/channel = "${{ steps.check.outputs.latest }}"/' rust-toolchain.toml + - name: Create GitHub App Token + if: steps.check.outputs.needs_update == 'true' + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 + id: app-token + with: + client-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_CLIENT_ID }} + private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }} + - name: Open pull request if: steps.check.outputs.needs_update == 'true' env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} run: | BRANCH="chore/update-rust-toolchain" TITLE="chore(toolchain): update Rust to ${{ steps.check.outputs.latest }}" BODY="Updates pinned Rust toolchain from \`${{ steps.check.outputs.current }}\` to \`${{ steps.check.outputs.latest }}\`." - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + git config user.name "pr-automation-bot-public[bot]" + git config user.email "pr-automation-bot-public[bot]@users.noreply.github.com" git checkout -b "$BRANCH" git add rust-toolchain.toml git commit -m "$TITLE"