Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ on:
sha:
description: Commit SHA to tag
required: false
pr_number:
description: Release PR number to relabel after tagging
required: false

permissions:
contents: write
issues: write
pull-requests: write

jobs:
tag:
Expand Down Expand Up @@ -63,3 +68,18 @@ jobs:
git remote set-url origin "https://x-access-token:${PUSH_TOKEN}@github.com/${{ github.repository }}.git"
git tag "$tag" "$TARGET_SHA"
git push origin "$tag"

- name: Mark release PR as tagged
if: github.event_name == 'pull_request_target' || github.event.inputs.pr_number != ''
env:
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
PR_NUMBER: ${{ github.event.inputs.pr_number || github.event.pull_request.number }}
run: |
gh api "repos/${{ github.repository }}/labels" \
-X POST \
-f name='autorelease: tagged' \
-f color='0e8a16' \
-f description='Release PR has been tagged' >/dev/null 2>&1 || true

gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/autorelease:%20pending" -X DELETE >/dev/null 2>&1 || true
gh issue edit "${PR_NUMBER}" --add-label 'autorelease: tagged'
Loading