Skip to content

Commit afa4d27

Browse files
Initial changes add backport automerge label (#6865)
* Add a label to backport PRs in preparation for backport automerge Signed-off-by: Peter Zhu <[email protected]> * Small tweaks Signed-off-by: Peter Zhu <[email protected]> --------- Signed-off-by: Peter Zhu <[email protected]>
1 parent e9ff189 commit afa4d27

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/backport.yml

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
1717
if: >
1818
github.event.pull_request.merged
19+
&& github.repository == 'opensearch-project/documentation-website'
1920
&& (
2021
github.event.action == 'closed'
2122
|| (
@@ -38,3 +39,12 @@ jobs:
3839
with:
3940
github_token: ${{ steps.github_app_token.outputs.token }}
4041
head_template: backport/backport-<%= number %>-to-<%= base %>
42+
43+
- name: Label new backport PR with backport-automerge label
44+
run: |
45+
PR_BRANCH=backport/backport-<%= number %>-to-<%= base %>
46+
PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"`
47+
echo "Update Backport PR #$PR_NUMBER on branch $PR_BRANCH with backport-automerge label"
48+
gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge
49+
env:
50+
GH_TOKEN: ${{ steps.github_app_token.outputs.token }}

.github/workflows/delete_merged_branch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
delete-branch:
99
runs-on: ubuntu-latest
1010
if: |
11-
startsWith(github.event.pull_request.head.repo.full_name, 'opensearch-project/documentation-website') &&
11+
github.repository == 'opensearch-project/documentation-website' &&
1212
${{ !startsWith(github.event.pull_request.head.ref, 'main') }} &&
1313
${{ !startsWith(github.event.pull_request.head.ref, '1.') }} &&
1414
${{ !startsWith(github.event.pull_request.head.ref, '2.') }} &&

0 commit comments

Comments
 (0)