Skip to content

Commit 4ec4c7d

Browse files
Philippe Matrayclaude
authored andcommitted
fix(ci): skip release-draft update on pull_request events
Release Drafter fails on every PR with "Validation Failed: target_commitish" because it tries to use refs/pull/NNN/merge as the release target. Gate the update_release_draft job with `if: github.event_name == 'push'` so it only runs on pushes to the default branch, while keeping the pull_request trigger so the autolabeler can be enabled later. Cherry-picks only the workflow fix from #161 (which was based on a stale main and carried unrelated changes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 11a1351 commit 4ec4c7d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
# otherwise, read permission is required at least
2626
pull-requests: write
2727
runs-on: ubuntu-latest
28+
# Only update the release draft on push to main, not on pull_request events.
29+
# Running on PRs causes "Validation Failed: target_commitish" because
30+
# release-drafter tries to set refs/pull/NNN/merge as the release target.
31+
if: github.event_name == 'push'
2832
steps:
2933
# (Optional) GitHub Enterprise requires GHE_HOST variable set
3034
#- name: Set GHE_HOST

0 commit comments

Comments
 (0)