Allow user-defined SHA and multiple additional tags #128
+14
−10
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.
This PR proposes three backward compatible changes:
Background
Commit SHA and git ref
Currently, the action uses the values of
$GITHUB_SHA
and$GITHUB_REF
to create image tags and labels. These environment variables are automatically set at the beginning of a workflow run, and refer to the event that triggered the workflow. In many cases, they are not the actual current values. For example, an earlier step or job might have added new commits, in which case$GITHUB_SHA
will not be the SHA of the commit from which the image is built. Another common scenario is when an earlier job decides which branch, tag, or commit must be used to make the image, and then initiates another job to checkout that ref.Additional tags
Currently, the action only allows for one additional tag by the user.
Changes
Add new optional action input
IMAGE_SHA
A new optional action input,
IMAGE_SHA
, is added, which defaults to$GITHUB_SHA
. Users now have the option to provide the correct values when they know that the actual commit SHA is not the same as$GITHUB_SHA
.Use
IMAGE_SHA
in place of$GITHUB_REF
Instead of using
$GITHUB_REF
(which may also be incorrect) to label the image, the already availableIMAGE_SHA
input is used. I believe this is also the default behavior when mybinder.org creates images.Allow multiple tags
Instead of a single tag, users can now also provide multiple tags as a comma-separated list.