Refine workflow for generating test-ubuntu-git
#1617
Merged
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.
The previous implementation used
env.GITHUB_SHA
to tag the generated container image, but it was flawed. The actual SHA was not embedded in the container image tag list.The problem stems from this nuance of Github Actions.
Two possible fixes are:
$GITHUB_SHA
)github
context (i.e.github.sha
)However, this flaw caused me to rethink the tagging strategy altogether. SHAs are useful, but don't communicate much to the consumer. The consumer has to walk back through the history to understand when the SHA was in play. In other words, it's impossible to get a sense of recency when looking at a SHA in isolation.
Semantic Versioning (e.g.
v1.0
) is typically the solution, butactions/checkout
already employs semantic versioning to communicate versions of the consumable action it represents. I worried that having two semantic versioning systems in play within the same repo could lead to confusion. Moreover, implementing semantic versioning correctly for container images (commonly viadocker/metadata-action
) also has its own complexity and gotchas.Above all, I expect that updates to the
test-ubuntu-git
container image will be very infrequent (about once per year), so I decided to go with a simpler approach here and tag the container images with a UTC timestamp.The format is inspired by ISO 8601 (sortable date/time) and has the following format:
<branch>.<year><month><day>.<hour><minute><second>.<millisecond>Z
(where the trailingZ
emphasizes that this is a UTC timestamp)Example
main.20240221.105506.339Z
Also in this PR
publish
(push toghcr.io
) opt-in behavior to themain
branch.publish
input parameter description to communicate that it's only valid on the main branch.