From a68630d5b77b2e9926f24ce6b4585a7ba99ab3f7 Mon Sep 17 00:00:00 2001 From: Vinicius Aquino Date: Wed, 7 Jul 2021 09:15:53 -0300 Subject: [PATCH] cicd: Add backport workflow This allow for easier backport of PRs to existing releases. Signed-off-by: Vinicius Aquino --- .github/workflows/backport.yaml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/backport.yaml diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 0000000..54dce5b --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,38 @@ +name: Backport labeled merged pull requests +on: + pull_request_target: + types: [closed] + issue_comment: + types: [created] +jobs: + build: + name: Create backport PRs + runs-on: ubuntu-latest + # Only run when pull request is merged + # or when a comment containing `/backport` is created + if: > + ( + github.event_name == 'pull_request_target' && + github.event.pull_request_target.merged + ) || ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request_target && + contains(github.event.comment.body, '/backport') + ) + steps: + - uses: actions/checkout@v2 + with: + # Required to find all branches + fetch-depth: 0 + - name: Create backport PRs + # Should be kept in sync with `version` + uses: zeebe-io/backport-action@v0.0.4 + with: + # Required + # Version of the backport-action + # Must equal the version in `uses` + # Recommended: latest tag or `master` + version: v0.0.4 + + github_token: ${{ secrets.GITHUB_TOKEN }} + github_workspace: ${{ github.workspace }}