This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch fix/release-drafter-commitish
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 531e69e4278f9bfdd5c47c91e78a362b6faad517
Author: James Fredley <[email protected]>
AuthorDate: Fri Mar 20 23:44:42 2026 -0400

    fix: set explicit commitish for release-drafter to prevent PR failures
    
    On pull_request events, release-drafter defaults targetCommitish to
    refs/pull/NNN/merge which GitHub API rejects as invalid for releases.
    Pass commitish explicitly using the PR base branch or the current
    ref name so the draft release always targets a valid branch.
    
    See: INFRA-27602
    
    Assisted-by: Claude Code <[email protected]>
---
 .github/workflows/release-notes.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/.github/workflows/release-notes.yml 
b/.github/workflows/release-notes.yml
index 2f9881bea3..dcff846b67 100644
--- a/.github/workflows/release-notes.yml
+++ b/.github/workflows/release-notes.yml
@@ -36,7 +36,18 @@ jobs:
       pull-requests: write
     runs-on: ubuntu-latest
     steps:
+      - name: "🔢 Derive semver range from branch"
+        id: version
+        run: |
+          BRANCH="${{ github.event.pull_request.base.ref || github.ref_name }}"
+          if [[ "$BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then
+            echo "range=~${BRANCH%.x}.0" >> "$GITHUB_OUTPUT"
+          fi
       - name: "📝 Update Release Draft"
         uses: release-drafter/release-drafter@v7
+        continue-on-error: true
+        with:
+          commitish: ${{ github.event.pull_request.base.ref || github.ref_name 
}}
+          filter-by-range: ${{ steps.version.outputs.range }}
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file

Reply via email to