Skip to content

Commit bf22863

Browse files
author
Ritchie
committed
fix(ci): remove pull_request trigger from Release Drafter workflow
The Release Drafter action was triggered on pull_request events, but when updating the draft release it used refs/pull/N/merge as target_commitish. GitHub's API rejects this ephemeral ref, causing: 'Validation Failed: {"resource":"Release","code":"invalid","field":"target_commitish"}' The autolabeler feature is not configured in .github/release-drafter.yml, so the pull_request trigger was not providing any value. Fix: Only run on push to main, which produces a valid target_commitish.
1 parent 684ee68 commit bf22863

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ on:
66
branches:
77
- main
88
# 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:
9+
# Removed: pull_request trigger caused "invalid target_commitish" errors
10+
# because refs/pull/N/merge is not a valid release commitish.
11+
# Re-add if autolabeler is enabled in .github/release-drafter.yml.
12+
# pull_request:
1413
# types: [opened, reopened, synchronize]
1514

1615
permissions:
@@ -26,16 +25,7 @@ jobs:
2625
pull-requests: write
2726
runs-on: ubuntu-latest
2827
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"
28+
# Drafts your next Release notes as Pull Requests are merged into "main"
3529
- 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
4030
env:
4131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)