Description
The Docker image we build is intended to use a directory base
context
. With this the image which is built is based upon the commit used inactions/checkout
. I intended to just simply dogit rev-parse HEAD
to get the checked out commit but the issue is that thedocker/metadata-action
when generating tags and annotations will end up pulling details about the commit SHA from the workflow metadata. This is why we need to useDOCKER_METADATA_PR_HEAD_SHA
at all to instruct the action which SHA to use when running as a PR.I did some experimenting here and tried to create the tags more manually using
type=raw
but ran into issue where thedocker/metadata-action
would fail when trying to use an arbitrary commit. As this was turning into a rabbit hole I didn't want to keep going down I opted to limit this action to only support PR merge commits and the head commit which are only use cases we use internally.The primary point of concern is we don't want to have our image tags or annotations stating the were built with one commit SHA when in reality they were built with another.
Originally posted by @omus in #1 (comment)