From af37bec8537569b63463d1cb81042cea669cd53c Mon Sep 17 00:00:00 2001 From: dlaw4608 Date: Wed, 8 May 2024 17:13:55 +0100 Subject: [PATCH] Created new job that uses a label from a forked PR to build an image for the Quay.io Kuadrant Operator Registry --- .github/workflows/build-images-base.yaml | 2 +- .github/workflows/build-images-pr.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-images-pr.yaml diff --git a/.github/workflows/build-images-base.yaml b/.github/workflows/build-images-base.yaml index 05dac9f42..bc3f7b768 100644 --- a/.github/workflows/build-images-base.yaml +++ b/.github/workflows/build-images-base.yaml @@ -207,4 +207,4 @@ jobs: username: ${{ secrets.IMG_REGISTRY_USERNAME }} password: ${{ secrets.IMG_REGISTRY_TOKEN }} - name: Print Image URL - run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" + run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" \ No newline at end of file diff --git a/.github/workflows/build-images-pr.yaml b/.github/workflows/build-images-pr.yaml new file mode 100644 index 000000000..807a465f9 --- /dev/null +++ b/.github/workflows/build-images-pr.yaml @@ -0,0 +1,15 @@ +name: PR Conditional Build and Push Image to Quay.io Repo + +on: + pull_request_target: + types: [labeled, opened, synchronize, reopened] + +jobs: + workflow-build: + if: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'forked_image_approved') }} + name: Calls build-images-base workflow + uses: ./.github/workflows/build-images-base.yaml + secrets: inherit + with: + kuadrantOperatorVersion: ${{ github.event.pull_request.user.login }}-${{ github.event.pull_request.number }} + kuadrantOperatorTag: ${{ github.event.pull_request.user.login }}-${{ github.event.pull_request.number }} \ No newline at end of file