Conversation
On a pull_request event, github.ref is refs/pull/<n>/merge and github.sha is the merge commit GitHub creates for the pull request. That commit is not reachable from any branch or tag, so an Octopus release pinned to it can fail to deploy later. It also disagrees with what the workflow built, since builds normally check out the branch head. Update the version controlled example and the git_ref and git_commit input descriptions to use github.head_ref and github.event.pull_request.head.sha, both of which fall back to the push values on every other event. This matches the advice already given for git_resources further down the README.
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.
Background
This README renders as the Marketplace listing, so its example is what people copy into their workflows. It currently suggests:
On a
pull_requestevent those resolve torefs/pull/<n>/mergeand the merge commit GitHub creates for the pull request. That commit is reachable only from the pull ref, never from a branch or a tag, so an Octopus release pinned to it can fail to resolve at deployment time. It also disagrees with what the workflow built, because a build normally checks out the branch head.Results
Version controlled example
Added a short paragraph under the example explaining why the two values differ on a pull request.
Inputs table
git_refnow suggests${{ github.head_ref || github.ref }}and warns against${{ github.ref }}on its own.git_commitnow suggests${{ github.event.pull_request.head.sha || github.sha }}and warns against${{ github.sha }}on its own.Both expressions fall back to the push values on every other event, so the example still works unchanged for
push,workflow_dispatch, andschedule.Testing
Documentation only. No change to
src,dist, oraction.yml, so behavior is unchanged.The pipes in
||are escaped as\|\|inside the table cells, since GitHub Flavored Markdown treats an unescaped pipe as a cell delimiter even inside a code span. The example blocks are fenced code, so they are left unescaped.Related
🤖 Generated with Claude Code