mirror of
https://github.com/saltstack/salt.git
synced 2025-04-15 09:10:20 +00:00
Add backports support
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
(cherry picked from commit 99cb7c0e08
)
This commit is contained in:
parent
e3ca4bfb19
commit
8f52a3c1f7
2 changed files with 63 additions and 0 deletions
15
.backportrc.json
Normal file
15
.backportrc.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"repoOwner": "saltstack",
|
||||
"repoName": "salt",
|
||||
"targetBranchChoices": ["master", "3006.x", "3005.x"],
|
||||
"autoMerge": false,
|
||||
"autoMergeMethod": "rebase",
|
||||
"branchLabelMapping": {
|
||||
"^backport:(.+)$": "$1"
|
||||
},
|
||||
"prTitle": "[BACKPORT] {commitMessages}",
|
||||
"publishStatusCommentOnSuccess": true,
|
||||
"sourcePRLabels": [
|
||||
"backport:complete"
|
||||
]
|
||||
}
|
48
.github/workflows/backport.yml
vendored
Normal file
48
.github/workflows/backport.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
name: Backport PR
|
||||
run-name: "Backport PR #${{ github.event.number }}"
|
||||
|
||||
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, 'backport:master') ||
|
||||
contains(github.event.pull_request.labels.*.name, 'backport:3006.x') ||
|
||||
contains(github.event.pull_request.labels.*.name, 'backport:3005.x')
|
||||
)
|
||||
&& (
|
||||
(github.event.action == 'labeled' && (
|
||||
contains(github.event.pull_request.labels.*.name, 'backport:master') ||
|
||||
contains(github.event.pull_request.labels.*.name, 'backport:3006.x') ||
|
||||
contains(github.event.pull_request.labels.*.name, 'backport:3005.x')
|
||||
))
|
||||
|| (github.event.action == 'closed')
|
||||
)
|
||||
steps:
|
||||
- name: Backport Action
|
||||
uses: sqren/backport-github-action@v8.9.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
auto_backport_label_prefix: "backport:"
|
||||
add_original_reviewers: true
|
||||
|
||||
- name: Info log
|
||||
if: ${{ success() }}
|
||||
run: jq -C '.' ~/.backport/backport.info.log
|
||||
|
||||
- name: Debug log
|
||||
if: ${{ failure() }}
|
||||
run: jq -C '.' ~/.backport/backport.debug.log
|
Loading…
Add table
Reference in a new issue