Skip to content

Commit

Permalink
add backport github action (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
nianyush authored Sep 21, 2023
1 parent 96372c7 commit 82ec3f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"repoOwner": "spectrocloud",
"repoName": "CanvOS",
"editor": "code",

"targetBranchChoices": ["master", "rc-4.0", "release-3.4"],

"autoMerge": false,
"autoMergeMethod": "squash",
"commitConflicts": true,
"branchLabelMapping": {
"^backport-(.+)$": "$1"
}
}
32 changes: 32 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Backport

on:
pull_request_target:
types: ["labeled", "closed"]

jobs:
backport:
name: Backport PR
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: 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: cat ~/.backport/backport.info.log

- name: Debug log
if: ${{ failure() }}
run: cat ~/.backport/backport.debug.log

0 comments on commit 82ec3f5

Please sign in to comment.