Skip to content

Commit

Permalink
ci: Automation for backporting PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler@tailscale.com>
  • Loading branch information
tylersmalley committed Jun 7, 2023
1 parent d251cbd commit a7d041d
Show file tree
Hide file tree
Showing 4 changed files with 7,284 additions and 5,627 deletions.
14 changes: 14 additions & 0 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"repoOwner": "tailscale-dev",
"repoName": "vscode-tailscale",

"targetBranchChoices": ["release-branch/v0.4"],

"branchLabelMapping": {
"^v(\\d+).(\\d+).\\d+$": "release-branch/v$1.$2"
},

"fork": false,

"targetPRLabels": ["backport"]
}
31 changes: 31 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
pull_request_target:
branches: ['main']
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/backport-github-action@e325a2d70df7264afa24c92b1d5feb2278ff63af
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
auto_backport_label_prefix: auto-backport-to-
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"@vscode/vsce": "^2.18.0",
"@vscode/webview-ui-toolkit": "^1.2.2",
"autoprefixer": "^10.4.14",
"backport": "^8.9.7",
"bufferutil": "^4.0.7",
"css-loader": "^6.7.3",
"eslint": "^8.34.0",
Expand Down
Loading

0 comments on commit a7d041d

Please sign in to comment.