From 66a0664aa6a449d2bbd5f83f79aec18118b70c55 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Kwon <855115+xiehan@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:14:16 +0100 Subject: [PATCH] chore: add automerge workflow to this repo --- .github/workflows/automerge.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..d4a85f3 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,24 @@ +name: automerge +on: + pull_request_target: + types: + - opened + - labeled + - ready_for_review + - reopened + - synchronize +concurrency: ${{ github.workflow }}-${{ github.ref }} +jobs: + automerge: + runs-on: ubuntu-latest + permissions: + contents: read + if: contains(github.event.pull_request.labels.*.name, 'automerge') && github.event.pull_request.draft == false + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Turn on automerge for this PR by a trusted user or bot + if: github.event.pull_request.user.login == 'team-tf-cdk' || contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) || github.actor == 'dependabot[bot]' + env: + GH_TOKEN: ${{ secrets.GH_COMMENT_TOKEN }} + run: gh pr merge --auto --squash ${{ github.event.pull_request.number }