ci(release): add issue labeling for dev releases

- Add label-pending-release.yml workflow to tag issues when PR created
- Update dev-release.yml to comment and label issues after npm publish
- Labels: pending-release (yellow), released-dev (blue)
- Auto-removes pending-release when released-dev is applied
This commit is contained in:
kaitranntt committed 2025-12-12 05:57:58 -05:00
1 parent 3c7e071b61
commit 5ef3e324f8
2 files changed
+98

No files matched your search

@@ -0,0 +1,40 @@
name: Label Pending Release
on:
pull_request:
types: [opened, reopened]
branches: [dev]
jobs:
label:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Label linked issues as pending-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Extract issue numbers from PR title and body
PR_TEXT="${{ github.event.pull_request.title }} ${{ github.event.pull_request.body }}"
ISSUES=$(echo "$PR_TEXT" | grep -oE "(Fixes|Closes|Resolves|Refs?) #[0-9]+" | grep -oE "#[0-9]+" | sort -u || true)
if [[ -z "$ISSUES" ]]; then
echo "No linked issues found in PR"
exit 0
fi
for ISSUE in $ISSUES; do
NUM=${ISSUE#\#}
echo "Labeling issue #$NUM as pending-release"
# Create label if doesn't exist
gh label create "pending-release" \
--color "fbca04" \
--description "Fix in review, awaiting merge" \
--repo ${{ github.repository }} 2>/dev/null || true
# Add label to issue
gh issue edit $NUM --add-label "pending-release" --repo ${{ github.repository }} || true
done