From 56d339df3b9faee44ebb851a9fc021a7fb9239b3 Mon Sep 17 00:00:00 2001 From: asyncapi-bot <61865014+asyncapi-bot@users.noreply.github.com> Date: Sun, 31 Oct 2021 18:11:16 +0100 Subject: [PATCH] ci: update global workflows --- .github/workflows/automerge.yml | 16 ++++++++++++++-- .github/workflows/autoupdate.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/autoupdate.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1968cb809..6104f4706 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -17,7 +17,7 @@ on: pull_request_review: types: - submitted - + jobs: autoapprove: @@ -44,4 +44,16 @@ jobs: MERGE_METHOD: "squash" MERGE_COMMIT_MESSAGE: "pull-request-title" MERGE_RETRIES: "20" - MERGE_RETRY_SLEEP: "30000" \ No newline at end of file + MERGE_RETRY_SLEEP: "30000" + + labelWhenApproved: + needs: [autoapprove] + name: Label when approved + runs-on: ubuntu-latest + steps: + - name: Label when approved + uses: pullreminders/label-when-approved-action@v1.0.7 + env: + APPROVALS: "1" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ADD_LABEL: "autoapproved" \ No newline at end of file diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml new file mode 100644 index 000000000..d147580ee --- /dev/null +++ b/.github/workflows/autoupdate.yml @@ -0,0 +1,28 @@ +#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 + +#This workflow is designed to work with: +# - autoapprove and automerge workflows for dependabot and asyncapibot. +# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against + +# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. +#Autoupdating to latest destination branch works only in the context of upstream repo and not forks + +name: autoupdate + +on: + push: {} + +jobs: + + autoupdate: + runs-on: ubuntu-latest + steps: + - name: Autoupdating + uses: docker://chinthakagodawita/autoupdate-action:v1 + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + PR_FILTER: "labelled" + PR_LABELS: "autoapproved" + PR_READY_STATE: "ready_for_review" + MERGE_CONFLICT_ACTION: "ignore"