Skip to content

Do not always push images#56

Merged
Bronek merged 2 commits intomainfrom
do_not_always_push
Sep 29, 2025
Merged

Do not always push images#56
Bronek merged 2 commits intomainfrom
do_not_always_push

Conversation

@Bronek
Copy link
Collaborator

@Bronek Bronek commented Sep 29, 2025

This stops unconditional push of container images e.g. in pull_request events.

The docker/build-push-action in most (except for the recently added GCC one) have the line ending with push=true, e.g.

outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true

The meaning of this last push=true is unclear, given the sane action also takes push parameter

push: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}

However, we are pushing a lot of images, including from pull_request events, so the push=true at the end of outputs seems a natural suspect to cause this.

@Bronek Bronek requested a review from bthomee September 29, 2025 17:22

merge:
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
if: ${{ github.event == 'push' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
Copy link
Collaborator Author

@Bronek Bronek Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, Github does not seem to accept if: ${{ env.PUSH }} at a job level, so we have to repeat the full condition here.

@Bronek Bronek merged commit b30e8e8 into main Sep 29, 2025
28 checks passed
@Bronek Bronek deleted the do_not_always_push branch September 29, 2025 19:55
@Bronek Bronek mentioned this pull request Oct 6, 2025
Bronek added a commit that referenced this pull request Oct 6, 2025
Image push was broken in #56 , let's try to fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants