Skip to content

Commit

Permalink
ci: Automation for backporting PRs (#12)
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 2c25199
Show file tree
Hide file tree
Showing 5 changed files with 7,286 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"]
}
29 changes: 29 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 }}

- name: Info log
if: ${{ success() }}
run: cat ~/.backport/backport.info.log

- name: Debug log
if: ${{ failure() }}
run: cat ~/.backport/backport.debug.log
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ To debug webviews in our VS Code extension, you can access the Developer Tools b

We make use of [Webview UI Toolkit for Visual Studio Code](https://www.npmjs.com/package/@vscode/webview-ui-toolkit), specifically for its [React Components](https://github.com/microsoft/vscode-webview-ui-toolkit/tree/main/src/react)](https://github.com/microsoft/vscode-webview-ui-toolkit/tree/main/src/react) which are wrappers around the components. These components follow the design language of VS Code to maintain a consistent look and feel.

### Backporting

To backport a PR, add the `auto-backport` label to a PR and a corresponding version label (example: `v0.4`). Once the PR is merged, a corresponding backport PR will be created against the release branch.

## Release Process

### Create or update an existing release branch
Expand Down
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 2c25199

Please sign in to comment.