Skip to content

Commit 023063c

Browse files
kompreclaude
andcommitted
Add manual workflow dispatch trigger to release workflow
Allow manual triggering of release workflow for testing and emergency releases. This helps debug why automatic PR close events aren't triggering the workflow. Usage: Manually run workflow from Actions tab with PR number. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5a61513 commit 023063c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
pull_request:
55
types: [closed]
66
branches: [main]
7+
workflow_dispatch:
8+
inputs:
9+
pr_number:
10+
description: 'PR number to release'
11+
required: true
12+
type: number
713

814
jobs:
915
check-release-label:
10-
if: github.event.pull_request.merged == true
16+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
1117
runs-on: ubuntu-latest
1218
outputs:
1319
should-release: ${{ steps.check.outputs.release }}
@@ -21,7 +27,14 @@ jobs:
2127
env:
2228
GH_TOKEN: ${{ github.token }}
2329
run: |
24-
LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
30+
# Get PR number from event or input
31+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
32+
PR_NUMBER=${{ inputs.pr_number }}
33+
else
34+
PR_NUMBER=${{ github.event.pull_request.number }}
35+
fi
36+
37+
LABELS=$(gh pr view $PR_NUMBER --json labels --jq '.labels[].name')
2538
2639
if echo "$LABELS" | grep -q "^release$"; then
2740
echo "release=true" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)