Skip to content

Commit 424413c

Browse files
authored
[ci] Added automated backport-workflow
1 parent 63f9f09 commit 424413c

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

.github/workflows/backport.yml

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

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
- name: Build package
3030
run: python -m build
3131
- name: Publish package distributions to PyPI
32-
uses: pypa/gh-action-pypi-publish@v1.13.0
32+
uses: pypa/gh-action-pypi-publish@v1.13.0

0 commit comments

Comments
 (0)