Skip to content

Commit

Permalink
add more
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Apr 2, 2024
1 parent 37e3596 commit 9418f55
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
on: [pull_request]
# pull_request_target:
# types:
# - closed
# - labeled

jobs:
backport:
Expand All @@ -14,27 +14,34 @@ jobs:
name: Backport
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
# if: >
# github.event.pull_request.merged
# && (
# github.event.action == 'closed'
# || (
# github.event.action == 'labeled'
# && contains(github.event.label.name, 'backport')
# )
# )
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
# opensearch-trigger-bot installation ID
installation_id: 22958780
# - name: GitHub App token
# id: github_app_token
# uses: tibdex/github-app-token@v1.5.0
# with:
# app_id: ${{ secrets.APP_ID }}
# private_key: ${{ secrets.APP_PRIVATE_KEY }}
# # opensearch-trigger-bot installation ID
# #installation_id: 22958780

- name: Backport
uses: VachaShah/backport@v2.1.0
with:
github_token: ${{ steps.github_app_token.outputs.token }}
head_template: backport/backport-<%= number %>-to-<%= base %>
# - name: Backport
# uses: VachaShah/backport@v2.1.0
# with:
# github_token: ${{ steps.github_app_token.outputs.token }}
# head_template: backport/backport-<%= number %>-to-<%= base %>

- name: Check gh
run: |
PR_BRANCH=test123123
gh pr list -R peterzhuamazon/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9418f55

Please sign in to comment.