From 7c78e96693660d460e944ab6cd4f23794c5a230a Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 23 Nov 2021 11:04:59 +0000 Subject: [PATCH] ci: update global workflows --- .github/workflows/automerge.yml | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 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..293acd7 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,59 @@ + # This action is centrally managed in https://github.com/asyncapi/.github/ + # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo. + +name: Automerge release bump PR + +on: + pull_request_target: + types: + - labeled + - unlabeled + - synchronize + - opened + - edited + - ready_for_review + - reopened + - unlocked + pull_request_review: + types: + - submitted + +jobs: + + autoapprove: + if: (github.event.pull_request.draft == false) && (github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && !contains(github.event.pull_request.labels.*.name, 'released') + runs-on: ubuntu-latest + steps: + - name: Autoapproving + uses: hmarr/auto-approve-action@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Label autoapproved + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['autoapproved'] + }) + + + automerge: + needs: [autoapprove] + runs-on: ubuntu-latest + steps: + - name: Automerging + uses: pascalgn/automerge-action@v0.13.0 + if: github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + env: + GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" + GITHUB_LOGIN: asyncapi-bot + MERGE_LABELS: "" + MERGE_METHOD: "squash" + MERGE_COMMIT_MESSAGE: "pull-request-title" + MERGE_RETRIES: "20" + MERGE_RETRY_SLEEP: "30000"