-
Notifications
You must be signed in to change notification settings - Fork 221
42 lines (36 loc) · 1.3 KB
/
Copy pathbackport.yml
File metadata and controls
42 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Backport
on:
pull_request_target:
types: ["labeled", "closed"]
permissions:
contents: write
pull-requests: write
jobs:
backport:
name: Backport PR
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'auto-backport')
&& (
(github.event.action == 'labeled' && github.event.label.name == 'auto-backport')
|| (github.event.action == 'closed')
)
steps:
- name: Backport Action
uses: sorenlouv/backport-github-action@v12
with:
# A PAT (repo + workflow scope) is required: org policy forbids the
# default GITHUB_TOKEN from creating PRs, and PRs opened with it also
# don't trigger downstream `pull_request` workflows (anti-recursion
# limit), so CI would not run on backport PRs. Configure a repo or
# org secret named AUTOMATION_PAT.
github_token: ${{ secrets.AUTOMATION_PAT }}
auto_backport_label_prefix: auto-backport-to-
copy_source_pr_reviewers: true
- name: Info log
if: ${{ success() }}
run: cat ~/.backport/backport.info.log
- name: Debug log
if: ${{ failure() }}
run: cat ~/.backport/backport.debug.log