Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 038ad91

Browse files
authored
Github action and backportrc config files (#360)
* Github action and backportrc config files
1 parent 450c92b commit 038ad91

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.backportrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// .backportrc.json
2+
{
3+
// example repo info
4+
"repoOwner": "mongodb",
5+
"repoName": "docs-cluster-to-cluster-sync",
6+
7+
// `targetBranch` option allows to automatically backport every PR to a specific branch without the need for labels
8+
"targetBranches": ["backport-gha-test"],
9+
10+
// the branches available to backport to
11+
"targetBranchChoices": ["backport-gha-test-2"], // will be "beta"
12+
13+
// In this case, adding the label "backport-to-production" will backport the PR to the "production" branch
14+
"branchLabelMapping": {
15+
"^backport-to-(.+)$": "$1"
16+
}
17+
}

.github/workflows/backport.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Automatic backport action
2+
3+
on:
4+
pull_request_target:
5+
types: ["labeled", "closed"]
6+
7+
jobs:
8+
backport:
9+
name: Backport PR
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Backport Action
13+
uses: sorenlouv/[email protected]
14+
with:
15+
github_token: ${{ secrets.BACKPORT_TOKEN }}
16+
auto_backport_label_prefix: backport-to-
17+
18+
- name: Info log
19+
if: ${{ success() }}
20+
run: cat ~/.backport/backport.info.log
21+
22+
- name: Debug log
23+
if: ${{ failure() }}
24+
run: cat ~/.backport/backport.debug.log
25+

0 commit comments

Comments
 (0)