metadata-action: The suggested default branch example does not work for schedule
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
Here is an example:
https://github.com/felipecrs/jenkins-agent-dind/blob/master/.github/workflows/ci.yml#L35
https://github.com/felipecrs/jenkins-agent-dind/runs/5964649319?check_suite_focus=true#step:3:31
I would say that this variable does not get filled properly for schedule events, which is meaningful, as metadata-action relies on it.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (18 by maintainers)
Commits related to this issue
- Fix not pushing image as latest on schedule With a workaround for https://github.com/docker/metadata-action/issues/184. — committed to felipecrs/docker-images by felipecrs 2 years ago
Yes let’s keep it that way in the meantime. Will see if there is some traction from other users for this pattern.
This action is not a general purpose one for other steps and only exposes what it does. It should be done upstream by GitHub.
I have many fixtures too that covers most of them or at least most important imo: https://github.com/docker/metadata-action/tree/master/__tests__/fixtures