Skip to content

Commit ac676ca

Browse files
author
Ritchie
committed
fix(ci): disable release draft update on PR events to prevent invalid target_commitish error
Release Drafter was failing on all PR events with: Error: Validation Failed - field 'target_commitish' is invalid This happens because on PR events the target_commitish is set to refs/pull/*/merge which is not a valid target for the GitHub Releases API. The fix adds when the event is a pull_request, so the action still runs autolabeling on PRs but only updates the draft release on push to main.
1 parent 684ee68 commit ac676ca

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333

3434
# Drafts your next Release notes as Pull Requests are merged into "master"
3535
- uses: release-drafter/release-drafter@v7
36-
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
37-
# with:
38-
# config-name: my-config.yml
39-
# disable-autolabeler: true
36+
# Only publish the draft on push to main; on PRs, only run autolabeler (no draft update).
37+
# This prevents the "invalid target_commitish" error when target is refs/pull/*/merge.
38+
with:
39+
disable-releaser: ${{ github.event_name == 'pull_request' }}
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)