jamesfredley opened a new pull request, #15524:
URL: https://github.com/apache/grails-core/pull/15524

   ## Summary
   
   - Fixes the `Release - Drafter` workflow failure visible on PRs like #15519
   - Addresses guidance from 
[INFRA-27602](https://issues.apache.org/jira/browse/INFRA-27602)
   
   ## Problem
   
   When the `release-notes.yml` workflow triggers on `pull_request` events, 
`release-drafter/release-drafter@v7` defaults `targetCommitish` to 
`refs/pull/NNN/merge` - a virtual merge ref that GitHub's API rejects as 
invalid for releases:
   
   ```
   ##[error]Validation Failed: 
{"resource":"Release","code":"invalid","field":"target_commitish"}
   ```
   
   This causes every PR to show a red check from the "Release - Drafter" 
workflow, even though the PR itself is fine.
   
   ## Fix
   
   Pass `commitish` explicitly so release-drafter always targets a valid branch:
   
   ```yaml
   with:
     commitish: ${{ github.event.pull_request.base.ref || github.ref_name }}
   ```
   
   This resolves correctly for all trigger types:
   
   | Trigger | `commitish` resolves to |
   |---------|------------------------|
   | `pull_request` to `7.0.x` | `7.0.x` (from 
`github.event.pull_request.base.ref`) |
   | `push` to `7.0.x` | `7.0.x` (from `github.ref_name`) |
   | `issues` | default branch (from `github.ref_name`) |
   | `workflow_dispatch` | selected branch (from `github.ref_name`) |
   
   The autolabeler continues to work on PR events as before - only the release 
draft target is fixed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to