Skip to content

Commit 54c9dc3

Browse files
authored
Adding auto backport functionality (opensearch-project#149)
Signed-off-by: Vacha Shah <vachshah@amazon.com>
1 parent 7ed477c commit 54c9dc3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/backport.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Backport
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
8+
jobs:
9+
backport:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
name: Backport
15+
steps:
16+
- name: GitHub App token
17+
id: github_app_token
18+
uses: tibdex/github-app-token@v1.5.0
19+
with:
20+
app_id: ${{ secrets.APP_ID }}
21+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
22+
installation_id: 22958780
23+
24+
- name: Backport
25+
uses: VachaShah/backport@v1.1.4
26+
with:
27+
github_token: ${{ steps.github_app_token.outputs.token }}
28+
branch_name: backport/backport-${{ github.event.number }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Delete merged branch of the backport PRs
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
delete-branch:
9+
runs-on: ubuntu-latest
10+
if: startsWith(github.event.pull_request.head.ref,'backport/')
11+
steps:
12+
- name: Delete merged branch
13+
uses: SvanBoxel/delete-merged-branch@main
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)