From b2d1f20ebe148053eb497a8d8afa3a37060dab47 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 15 Jan 2025 19:11:57 +0000 Subject: [PATCH] Update licenses-update.yml --- .github/workflows/licenses-update.yml | 37 ++++++++++++--------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/licenses-update.yml b/.github/workflows/licenses-update.yml index 142938d4..5ddc6436 100644 --- a/.github/workflows/licenses-update.yml +++ b/.github/workflows/licenses-update.yml @@ -22,6 +22,13 @@ jobs: with: egress-policy: audit + - name: Generate GitHub App Token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.GH_APP_ID }} + private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + - name: Check out code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -42,8 +49,8 @@ jobs: - name: Set up git config run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "stirlingbot[bot]" + git config --global user.email "1113334+stirlingbot[bot]@users.noreply.github.com" - name: Run git add run: | @@ -53,34 +60,24 @@ jobs: - name: Create Pull Request id: cpr if: env.CHANGES_DETECTED == 'true' - uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 + uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ steps.generate-token.outputs.token }} commit-message: "Update 3rd Party Licenses" - committer: GitHub Action - author: GitHub Action + committer: "stirlingbot[bot] <1113334+stirlingbot[bot]@users.noreply.github.com>" + author: "stirlingbot[bot] <1113334+stirlingbot[bot]@users.noreply.github.com>" signoff: true branch: update-3rd-party-licenses title: "Update 3rd Party Licenses" body: | - Auto-generated by [create-pull-request][1] - - [1]: https://github.com/peter-evans/create-pull-request + Auto-generated by StirlingBot labels: licenses,github-actions draft: false delete-branch: true sign-commits: true - - name: Auto approve + - name: Enable Pull Request Automerge if: steps.cpr.outputs.pull-request-operation == 'created' - run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}" + run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Enable auto-merge - if: steps.cpr.outputs.pull-request-operation == 'created' - uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - merge-method: squash # Choose the merge method: merge, squash, or rebase + GH_TOKEN: ${{ steps.generate-token.outputs.token }}