Skip to content

Support building arbitrary commits #2

Open
@omus

Description

@omus

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 in actions/checkout. I intended to just simply do git rev-parse HEAD to get the checked out commit but the issue is that the docker/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 use DOCKER_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 the docker/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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions