]> code.ossystems Code Review - meta-freescale.git/commitdiff
cicd: Add backport workflow
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 15 Jun 2021 12:16:49 +0000 (09:16 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 15 Jun 2021 12:18:26 +0000 (09:18 -0300)
This allow for easier backport of PRs to existing releases.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Change-Id: I72a56eb47f37dd204ad2ae56368b8973f1fdf9cb

.github/workflows/backport.yaml [new file with mode: 0644]

diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml
new file mode 100644 (file)
index 0000000..a39e7e5
--- /dev/null
@@ -0,0 +1,23 @@
+name: Backport
+on:
+  pull_request_target:
+    types: [closed, labeled]
+jobs:
+  backport:
+    name: Backport Pull Request
+    if: github.repository_owner == 'Freescale' && github.event.pull_request.merged == true
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          # required to find all branches
+          fetch-depth: 0
+          ref: ${{ github.event.pull_request.head.sha }}
+      - name: Create backport PRs
+        # should be kept in sync with `version`
+        uses: zeebe-io/backport-action@9b8949dcd4295d364b0939f07d0c7593598d26cd
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          github_workspace: ${{ github.workspace }}
+          # should be kept in sync with `uses`
+          version: 9b8949dcd4295d364b0939f07d0c7593598d26cd