Skip to content

Commit 2db0ac7

Browse files
committed
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>
1 parent 60aec30 commit 2db0ac7

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

.github/workflows/backport.yaml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
name: Backport labeled merged pull requests
1+
name: Backport merged pull requests
22
on:
33
pull_request_target:
4-
types: [closed]
4+
types: [closed, labeled]
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
510
jobs:
6-
build:
11+
backport:
712
name: Create backport PRs
813
runs-on: ubuntu-latest
9-
# Only run when pull request is merged
10-
# or when a comment containing `/backport` is created
14+
# Run on merged PRs that carry a 'backport <branch>' label, whether the
15+
# label was added before the merge or afterwards.
1116
if: github.event.pull_request.merged
1217
steps:
13-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1419
with:
15-
# Required to find all branches
1620
fetch-depth: 0
17-
- name: Create backport PRs
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 }}
21+
- uses: korthout/backport-action@v4

0 commit comments

Comments
 (0)