From c4041b39f280c32d2d448391ce70937c3e79ceee Mon Sep 17 00:00:00 2001 From: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com> Date: Sun, 18 Aug 2024 16:27:34 -0400 Subject: [PATCH] ci: Switch to GitHub App token (#170) --- .github/workflows/fixtures.yml | 7 ++++++- .github/workflows/rust-version.yml | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fixtures.yml b/.github/workflows/fixtures.yml index c66977a4..818300eb 100644 --- a/.github/workflows/fixtures.yml +++ b/.github/workflows/fixtures.yml @@ -76,10 +76,15 @@ jobs: path: ${{ github.workspace }}/${{ env.MOVE_FIXTURE_PATH }} pattern: "move_*" merge-multiple: true + - uses: tibdex/github-app-token@v2 + id: generate-token + with: + app_id: ${{ secrets.TOKEN_APP_ID }} + private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }} - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: - token: "${{ secrets.REPO_TOKEN }}" + token: ${{ steps.generate-token.outputs.token }} branch: "ci-update-fixtures" title: "chore: Update fixtures" commit-message: "chore: Update fixtures" diff --git a/.github/workflows/rust-version.yml b/.github/workflows/rust-version.yml index 6e2f89ff..9e8d7566 100644 --- a/.github/workflows/rust-version.yml +++ b/.github/workflows/rust-version.yml @@ -33,12 +33,18 @@ jobs: run: | sed -i 's/channel = .*/channel = "nightly-${{ env.RUST_VERSION }}"/' rust-toolchain.toml working-directory: ${{ github.workspace }}/${{ matrix.package }} + - uses: tibdex/github-app-token@v2 + if: steps.compare-versions.outputs.outdated == 'true' + id: generate-token + with: + app_id: ${{ secrets.TOKEN_APP_ID }} + private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }} # Open PR if Rust version is out of date with latest nightly - name: Create Pull Request if: steps.compare-versions.outputs.outdated == 'true' uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.REPO_TOKEN }} + token: ${{ steps.generate-token.outputs.token }} branch: "ci-update-rust-version-${{ matrix.package }}" title: "chore: Update `${{ matrix.package }}` Rust version to `nightly-${{ env.RUST_VERSION }}`" commit-message: "chore: Update `${{ matrix.package }}` Rust version to `nightly-${{ env.RUST_VERSION }}`"