Debian Codegraph @

.github/workflows/backport.yml

raw
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 }}