Skip to content

Commit 9b49b6f

Browse files
authored
fix: Skip release-drafter on pull_request events (#264)
## Summary Release-drafter fails with `Validation Failed: {"resource":"Release","code":"invalid","field":"target_commitish"}` when triggered by `pull_request` events. This happens because in the PR context, the git ref is a temporary merge commit (`refs/pull/N/merge`), which the GitHub API rejects as an invalid `target_commitish` for a release. Fix: add `if: github.event_name == 'push'` to the "Prepare release notes" step so it only runs on pushes to `main` / tags, where the ref points to a real branch.
1 parent e416abe commit 9b49b6f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- name: Test
2323
run: mvn --batch-mode --update-snapshots verify
2424
- name: Prepare release notes
25+
if: github.event_name == 'push'
2526
uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6, specifically v6.1.0
2627
with:
2728
config-name: release-drafter.yml

0 commit comments

Comments
 (0)