-
Notifications
You must be signed in to change notification settings - Fork 212
49 lines (43 loc) · 1.49 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Backport PR to LTS release branch(es)"
on:
pull_request_target:
branches:
- main
types:
- labeled
- closed
permissions: read-all
jobs:
backport:
name: Backport PR
permissions:
pull-requests: write
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: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# This is necessary as the repository is checked out to avoid merge conflicts
# on daily canary file
- name: Sets committer to GitHub Actions bot
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Local canary file always wins
run: |
git config --local include.path .gitconfig
git config --global merge.keeplocal.name "Always keep local file during merge"
git config --global merge.keeplocal.driver true
# Update backport action (https://github.com/sqren/backport/issues/391#issuecomment-1156355381)
- name: Backport Action
uses: sorenlouv/backport-github-action@main
with:
github_token: ${{ secrets.BACKPORT_ACTION }}