-
Notifications
You must be signed in to change notification settings - Fork 15
29 lines (28 loc) · 993 Bytes
/
backport.yml
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: backport
on:
pull_request_target:
types:
- labeled
- unlabeled
- closed
jobs:
backport:
name: Backport PR
runs-on: ubuntu-latest
permissions: {}
if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport'))
steps:
- name: Check for backport labels
id: check_labels
run: |-
labels='${{ toJSON(github.event.pull_request.labels.*.name) }}'
matched=$(echo $labels | jq '.|map(select(startswith("backport-to-"))) | length')
echo "matched=$matched"
echo "matched=$matched" >> $GITHUB_OUTPUT
- name: Backport Action
if: fromJSON(steps.check_labels.outputs.matched) > 0
uses: sqren/backport-github-action@v9.5.1
with:
github_token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
auto_backport_label_prefix: backport-to-