Skip to content

Commit 213ea32

Browse files
author
Ritchie
committed
fix(ci): remove pull_request trigger from release-drafter workflow
The release-drafter action fails when triggered on pull_request events because it attempts to update the draft release with target_commitish set to refs/pull/XXX/merge, which GitHub's API rejects with: Validation Failed: {resource:Release, code:invalid, field:target_commitish} The pull_request trigger is only needed for the autolabeler feature, which is not configured in this repo. Removing it so the workflow only runs on push to main, which is the correct and intended behavior. Fixes recurring failures on runs: 23369773059, 23369768998, 23111592904
1 parent 684ee68 commit 213ea32

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@ name: Release Drafter
22

33
on:
44
push:
5-
# branches to consider in the event; optional, defaults to all
5+
# Only draft releases when pushing to main
66
branches:
77
- main
8-
# pull_request event is required only for autolabeler
9-
pull_request:
10-
# Only following types are handled by the action, but one can default to all as well
11-
types: [opened, reopened, synchronize]
12-
# pull_request_target event is required for autolabeler to support PRs from forks
13-
# pull_request_target:
14-
# types: [opened, reopened, synchronize]
8+
# pull_request trigger removed: causes "invalid target_commitish" error
9+
# when release-drafter tries to update draft release with refs/pull/XXX/merge.
10+
# Autolabeler is not in use here, so the pull_request trigger is unnecessary.
1511

1612
permissions:
1713
contents: read
@@ -26,12 +22,7 @@ jobs:
2622
pull-requests: write
2723
runs-on: ubuntu-latest
2824
steps:
29-
# (Optional) GitHub Enterprise requires GHE_HOST variable set
30-
#- name: Set GHE_HOST
31-
# run: |
32-
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
33-
34-
# Drafts your next Release notes as Pull Requests are merged into "master"
25+
# Drafts your next Release notes as Pull Requests are merged into "main"
3526
- uses: release-drafter/release-drafter@v7
3627
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
3728
# with:

0 commit comments

Comments
 (0)