bakdata / ci-templates

Collection of reusable workflows and composite actions for Github
MIT License
4 stars 1 forks source link

Reflect branch's latest commit SHA in non-release image tags #120

Closed JakobEdding closed 4 months ago

JakobEdding commented 1 year ago

The docker-publish action uses variable GITHUB_SHA to tag images: https://github.com/bakdata/ci-templates/blob/8e5f4dbd8ede7c49f1dab22e0c0a6a847e4aa26d/actions/docker-publish/action.yaml#L20

In case the event triggering the docker-publish action is a pull request, the GITHUB_SHA used in image tag is a commit SHA that is dynamically generated by GitHub and differs from the branch's latest commit SHA. More information here: https://github.com/orgs/community/discussions/25191#discussioncomment-3246770

To easily match dev deployments to open PRs, it would be helpful if the SHA in the image tag would reflect the branch's latest commit SHA.

JakobEdding commented 4 months ago

If we used https://github.com/docker/metadata-action for formatting image tags, we could probably solve this by setting DOCKER_METADATA_PR_HEAD_SHA