Skip to content

Commit 277404e

Browse files
committed
fix: mark release prs as tagged after tagging
1 parent 38914b6 commit 277404e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/tag-release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ on:
1212
sha:
1313
description: Commit SHA to tag
1414
required: false
15+
pr_number:
16+
description: Release PR number to relabel after tagging
17+
required: false
1518

1619
permissions:
1720
contents: write
21+
issues: write
22+
pull-requests: write
1823

1924
jobs:
2025
tag:
@@ -63,3 +68,18 @@ jobs:
6368
git remote set-url origin "https://x-access-token:${PUSH_TOKEN}@github.com/${{ github.repository }}.git"
6469
git tag "$tag" "$TARGET_SHA"
6570
git push origin "$tag"
71+
72+
- name: Mark release PR as tagged
73+
if: github.event_name == 'pull_request_target' || github.event.inputs.pr_number != ''
74+
env:
75+
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
76+
PR_NUMBER: ${{ github.event.inputs.pr_number || github.event.pull_request.number }}
77+
run: |
78+
gh api "repos/${{ github.repository }}/labels" \
79+
-X POST \
80+
-f name='autorelease: tagged' \
81+
-f color='0e8a16' \
82+
-f description='Release PR has been tagged' >/dev/null 2>&1 || true
83+
84+
gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/autorelease:%20pending" -X DELETE >/dev/null 2>&1 || true
85+
gh issue edit "${PR_NUMBER}" --add-label 'autorelease: tagged'

0 commit comments

Comments
 (0)