Skip to content

Commit 713f4ab

Browse files
feat(rel): add backport GHA to Jetbrains (#2650)
Having tested backport functionality in the [Cody repo](sourcegraph/cody#6119) I'm now adding it here too. This PR adds a backport github action based our backport tooling in sourcegraph/backport It uses the almost the same label as the Cody one, but with a slightly different base branch (backport jetbrains-v<version-number>). Notably, the `jetbrains-v<version-number>` branch doesn't appear to be the standard here, but I think we should adopt the same convention that is used in Cody. ## Test plan CI <!-- All pull requests REQUIRE a test plan: https://sourcegraph.com/docs/dev/background-information/testing_principles Why does it matter? These test plans are there to demonstrate that are following industry standards which are important or critical for our customers. They might be read by customers or an auditor. There are meant be simple and easy to read. Simply explain what you did to ensure your changes are correct! Here are a non exhaustive list of test plan examples to help you: - Making changes on a given feature or component: - "Covered by existing tests" or "CI" for the shortest possible plan if there is zero ambiguity - "Added new tests" - "Manually tested" (if non trivial, share some output, logs, or screenshot) - Updating docs: - "previewed locally" - share a screenshot if you want to be thorough - Updating deps, that would typically fail immediately in CI if incorrect - "CI" - "locally tested" --> --------- Co-authored-by: Kalan <[email protected]>
1 parent 33fe064 commit 713f4ab

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/backport.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Backport
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
8+
jobs:
9+
backport:
10+
name: Backport
11+
runs-on: ubuntu-latest
12+
# Only react to merged PRs for security reasons.
13+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
14+
if: >
15+
github.event.pull_request.merged
16+
&& (
17+
github.event.action == 'closed'
18+
|| (
19+
github.event.action == 'labeled'
20+
&& contains(github.event.label.name, 'backport')
21+
)
22+
)
23+
steps:
24+
- uses: sourcegraph/backport@v2
25+
with:
26+
github_token: ${{ secrets.BACKPORT_GITHUB_TOKEN }}
27+
label_pattern: '^backport (?<base>jb-v\d+\.\d+\.x)$'

0 commit comments

Comments
 (0)