From b04c1d7a0f7d628c84700189481ae96da02fd0eb Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Sun, 1 May 2022 12:58:02 -0700 Subject: [PATCH] .github: auto-merge bot pull requests (#268) Adds workflow to auto-merge cadobot pull requests. --- .github/workflows/pr.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..292a8b3 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,20 @@ +name: pr +permissions: + contents: read +on: + pull_request: +jobs: + automerge: + runs-on: ubuntu-latest + steps: + - name: Generate Bot Token + uses: tibdex/github-app-token@586e1a624db6a5a4ac2c53daeeded60c5e3d50fe # v1.5.2 + id: bot + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Automerge Bot Pull Requests + if: ${{ github.actor == 'cadobot[bot]' }} + run: gh pr merge --auto --squash ${{ github.event.pull_request.number }} + env: + GITHUB_TOKEN: ${{ steps.bot.outputs.token }}