summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2026-06-14 01:24:15 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2026-06-14 01:24:15 -0300
commit9206a576fc827de96402ad1ce43e35a59a60b462 (patch)
treebcc2b3984d157d5bcc291e2b67b876f4e7f7487b
parentd92b31a1a177181db488ce0b6f12041ac391e941 (diff)
downloadmeta-freescale-9206a576fc827de96402ad1ce43e35a59a60b462.tar.gz
backport: Modernise the backport workflow
The workflow used the deprecated zeebe-io/backport-action@v0.0.4 and relied on the default GITHUB_TOKEN, which is read-only by default, so it could not actually create the backport branches and pull requests. Switch to the maintained korthout/backport-action@v4, grant the required contents and pull-requests write permissions, and bump actions/checkout to v4. Trigger on both 'closed' and 'labeled' so a 'backport <branch>' label backports automatically on merge whether it was added before or after merging, with no manual /backport comment. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--.github/workflows/backport.yaml31
1 files changed, 12 insertions, 19 deletions
diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml
index cf3177704..6faabda04 100644
--- a/.github/workflows/backport.yaml
+++ b/.github/workflows/backport.yaml
@@ -1,28 +1,21 @@
1name: Backport labeled merged pull requests 1name: Backport merged pull requests
2on: 2on:
3 pull_request_target: 3 pull_request_target:
4 types: [closed] 4 types: [closed, labeled]
5
6permissions:
7 contents: write
8 pull-requests: write
9
5jobs: 10jobs:
6 build: 11 backport:
7 name: Create backport PRs 12 name: Create backport PRs
8 runs-on: ubuntu-latest 13 runs-on: ubuntu-latest
9 # Only run when pull request is merged 14 # Run on merged PRs that carry a 'backport <branch>' label, whether the
10 # or when a comment containing `/backport` is created 15 # label was added before the merge or afterwards.
11 if: github.event.pull_request.merged 16 if: github.event.pull_request.merged
12 steps: 17 steps:
13 - uses: actions/checkout@v2 18 - uses: actions/checkout@v4
14 with: 19 with:
15 # Required to find all branches
16 fetch-depth: 0 20 fetch-depth: 0
17 - name: Create backport PRs 21 - uses: korthout/backport-action@v4
18 # Should be kept in sync with `version`
19 uses: zeebe-io/backport-action@v0.0.4
20 with:
21 # Required
22 # Version of the backport-action
23 # Must equal the version in `uses`
24 # Recommended: latest tag or `master`
25 version: v0.0.4
26
27 github_token: ${{ secrets.GITHUB_TOKEN }}
28 github_workspace: ${{ github.workspace }}