Skip to content

Conversation

AAriam
Copy link

@AAriam AAriam commented Dec 5, 2024

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 available IMAGE_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.

@AAriam AAriam changed the title Add action inputs IMAGE_SHA and IMAGE_REF for git commit SHA and ref Allow user-defined SHA and multiple additional tags Dec 5, 2024
Instead of lowercasing only when no explicit image name is provided, always lowercase the image name as docker doesn't accept uppercase letters anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant