Skip to content

Commit

Permalink
Merge pull request #65270 from s0undt3ch/hotfix/backport
Browse files Browse the repository at this point in the history
[freeze] Upgrade to `sqren/[email protected]`
  • Loading branch information
s0undt3ch authored Sep 24, 2023
2 parents bc489f2 + aad2f67 commit 1406599
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -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 changes: 48 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit 1406599

Please sign in to comment.