From 409d14103e7710c6a011f33bd0b67b0e2fa7807a Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 6 Nov 2023 14:33:18 -0600 Subject: [PATCH 1/3] Remove ubi8 image builds Signed-off-by: Evan Lezar --- .github/workflows/build-images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index be65572d..d2df034f 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dist: [ubuntu20.04, ubi8] + dist: [ubuntu20.04] steps: - uses: actions/checkout@v3 From 2a78de23ab6319d16d964cce78ab93dcf1605d41 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 21 Nov 2023 11:25:01 +0100 Subject: [PATCH 2/3] Set image source label Signed-off-by: Evan Lezar --- .github/workflows/build-images.yaml | 3 +++ deployments/container/Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index d2df034f..37a742e1 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -40,6 +40,9 @@ jobs: run: | echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV + REPO_FULL_NAME="${{ github.event.pull_request.head.repo.full_name }}" + echo "${REPO_FULL_NAME}" + echo "LABEL_IMAGE_SOURCE=https://github.com/${REPO_FULL_NAME}" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/deployments/container/Makefile b/deployments/container/Makefile index 41284dd3..6e3d57e6 100644 --- a/deployments/container/Makefile +++ b/deployments/container/Makefile @@ -85,6 +85,7 @@ $(IMAGE_TARGETS): image-%: --build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \ --build-arg VERSION="$(VERSION)" \ --build-arg GIT_COMMIT="$(GIT_COMMIT)" \ + $(if $(LABEL_IMAGE_SOURCE),--label "org.opencontainers.image.source=$(LABEL_IMAGE_SOURCE)",) \ -f $(DOCKERFILE) \ $(CURDIR) From ed9186179d7ab95427aa9a43819d546f01363232 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 21 Nov 2023 11:27:53 +0100 Subject: [PATCH 3/3] Fix image build trigger Signed-off-by: Evan Lezar --- .github/workflows/build-images.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 37a742e1..55452d5e 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -27,7 +27,8 @@ on: jobs: build-image: - if: (github.event.action != 'closed' || github.event.pull_request.merged == true) + # We trigger builds on MERGED pull requests or on non-closed PRs that are not created against a fork. + if: (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true) || (github.event_name == 'pull_request' && github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository) runs-on: ubuntu-latest strategy: matrix: