CI: Query base.ref instead of sha for milestone VERSION resolution#7463
Open
ArthPatel1502 wants to merge 1 commit into
Open
CI: Query base.ref instead of sha for milestone VERSION resolution#7463ArthPatel1502 wants to merge 1 commit into
ArthPatel1502 wants to merge 1 commit into
Conversation
echoix
reviewed
Jun 1, 2026
| -H "Accept: application/vnd.github.raw" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.sha }}" | ||
| "/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.event.pull_request.base.ref }}" |
Member
There was a problem hiding this comment.
What about merge_commit_sha in https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=closed#pull_request
In https://docs.github.com/en/rest/pulls/pulls?apiVersion=2026-03-10#get-a-pull-request, it shows that if the PR is merged (which is what is checked on line 13, then it is a sha (so less user-controllable).
Suggested change
| "/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.event.pull_request.base.ref }}" | |
| "/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.event.pull_request. merge_commit_sha }}" |
It might still be needed to change into an env var to not evaluate the template directly for zizmor checks to be happy (which is a good thing).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7374. Updates the milestones workflow to look up the version file using the target PR base branch ref instead of the commit SHA.