Skip to content

Commit

Permalink
Add backport and auto delete workflow (opensearch-project#130)
Browse files Browse the repository at this point in the history
Signed-off-by: Annie Lee <[email protected]>
  • Loading branch information
Annie Lee authored Mar 10, 2022
1 parent fb43b22 commit bdd8a81
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
name: Backport
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780

- name: Backport
uses: VachaShah/[email protected]
with:
github_token: ${{ steps.github_app_token.outputs.token }}
branch_name: backport/backport-${{ github.event.number }}
15 changes: 15 additions & 0 deletions .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Delete merged branch of the backport PRs
on:
pull_request:
types:
- closed

jobs:
delete-branch:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.head.ref,'backport/')
steps:
- name: Delete merged branch
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ Launch Intellij IDEA, choose **Import Project**, and select the `settings.gradle

### Submitting Changes

See [CONTRIBUTING](CONTRIBUTING.md).
See [CONTRIBUTING](CONTRIBUTING.md).

### Backport

- [Link to backport documentation](https://github.com/opensearch-project/opensearch-plugins/blob/main/BACKPORT.md)

0 comments on commit bdd8a81

Please sign in to comment.