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.
SUMMARY
Add two optional parameters to the task:
ref:
, which will override the defaultGITHUB_REF
valuesha:
, which will override the defaultGITHUB_SHA
valueDETAILS
Allowing the user to specify exactly what branch name and commit SHA to pass to the Azure pipeline is necessary for workflows that trigger from non-pull-request events like
issue_comment
. For security reasons, it's impossible to override the values ofGITHUB_REF
andGITHUB_SHA
in the environment, which means for these workflows these values will always be pointing at the current tip of the default branch (e.g.main
/master
). That makes it impossible to trigger an Azure pipeline pointing at the current head branch of a pull request from an issue comment.By supporting these optional parameters, we can allow the workflow to use an inline github script or other avenue to retrieve the desired ref/sha from the event pull request, and then pass them to the Azure pipeline.
An example of what that might look like:
(This example based on the excellent comment here: actions/checkout#331 (comment))