-
Notifications
You must be signed in to change notification settings - Fork 30
53 lines (43 loc) · 1.58 KB
/
Copy pathsync_dev_to_main.yml
File metadata and controls
53 lines (43 loc) · 1.58 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
43
44
45
46
47
48
49
50
51
52
53
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileNotice: Part of the AddonManager.
name: Take a PR from dev to main
on:
pull_request_target:
types: [closed, labeled]
branches: [dev]
permissions:
contents: write
pull-requests: write
jobs:
backport:
name: Create release pull request
runs-on: ubuntu-latest
# Run the action if a PR is merged with "release to main" label
# OR
# when already merged PR is labeled with "release to main" label
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& startsWith(github.event.label.name, 'release to ')
)
)
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Create backport pull requests
uses: korthout/backport-action@ca4972adce8039ff995e618f5fc02d1b7961f27a # v3.3.0
with:
# Inputs documented here: https://github.com/korthout/backport-action?tab=readme-ov-file#inputs
github_token: ${{ github.token }}
github_workspace: ${{ github.workspace }}
# permit PRs with merge commits to be backported
merge_commits: 'skip'
# copy labels to backport to identify affected systems and priorities
copy_labels_pattern: '.*'
# Regex pattern to match github labels
# The capture group catches the target branch
# i.e. label "release to main" will create PR against main
label_pattern: ^release to ([^ ]+)$