Skip to content

Commit 7d5d2fb

Browse files
authored
Add backport and auto delete workflow (opensearch-project#283)
Signed-off-by: Annie Lee <leeyun@amazon.com>
1 parent e9351ce commit 7d5d2fb

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/backport.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
name: Backport
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
- labeled
8+
9+
jobs:
10+
backport:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
name: Backport
16+
steps:
17+
- name: GitHub App token
18+
id: github_app_token
19+
uses: tibdex/github-app-token@v1.5.0
20+
with:
21+
app_id: ${{ secrets.APP_ID }}
22+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
23+
installation_id: 22958780
24+
25+
- name: Backport
26+
uses: VachaShah/backport@v1.1.4
27+
with:
28+
github_token: ${{ steps.github_app_token.outputs.token }}
29+
branch_name: backport/backport-${{ github.event.number }}
Lines changed: 15 additions & 0 deletions
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)