Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make strict rules on amd64 experimental builds #76

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/reusable_dockerfile_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@ jobs:
# only push if the branch/PR is not generated from a fork. Even though
# forks can't push, we still want to try and build the image to catch
# bugs. For testing purposes we only need an amd64 image.
- name: Build and Push Docker Image amd64
- name: Build and Push Experimental Docker Image amd64
# This will run only when the event is a push to a branch that is not 'main'
# and the ref is not a release candidate or release tag.
if: >-
github.event_name == 'push' &&
github.ref != 'refs/heads/main' &&
!startsWith(github.ref, 'refs/tags/v') &&
!contains(github.ref, '-rc') &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
Copy link
Member

Choose a reason for hiding this comment

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

This means it does not build on a fork, which should happen, to report back an error to the developer if something breaks.
Building it always and only pushing on non-forks results in that behavior.

uses: docker/build-push-action@v5
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
Expand All @@ -150,9 +158,7 @@ jobs:
provenance: false
platforms: linux/amd64
# Only push if the head and base repos match, meaning it is not a fork
# yamllint disable
push: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
# yamllint enable
push: true
Bidon15 marked this conversation as resolved.
Show resolved Hide resolved
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ${{ inputs.dockerfile }}
Expand Down