Skip to content

Commit 867c723

Browse files
committed
[ci] Added automated backport workflow
1 parent 4f38773 commit 867c723

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/backport.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Backport fixes to stable branch
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
issue_comment:
9+
types: [created]
10+
11+
concurrency:
12+
group: backport-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
backport-on-push:
21+
if: github.event_name == 'push'
22+
uses: openwisp/openwisp-utils/.github/workflows/reusable-backport.yml@master
23+
with:
24+
commit_sha: ${{ github.sha }}
25+
secrets:
26+
app_id: ${{ secrets.OPENWISP_BOT_APP_ID }}
27+
private_key: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }}
28+
29+
backport-on-comment:
30+
if: >
31+
github.event_name == 'issue_comment' &&
32+
github.event.issue.pull_request &&
33+
github.event.issue.pull_request.merged_at != null &&
34+
github.event.issue.state == 'closed' &&
35+
contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) &&
36+
startsWith(github.event.comment.body, '/backport')
37+
uses: openwisp/openwisp-utils/.github/workflows/reusable-backport.yml@master
38+
with:
39+
pr_number: ${{ github.event.issue.number }}
40+
comment_body: ${{ github.event.comment.body }}
41+
secrets:
42+
app_id: ${{ secrets.OPENWISP_BOT_APP_ID }}
43+
private_key: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }}

0 commit comments

Comments
 (0)