From a884150d9c973c690ffd1279315f211d542d4aa3 Mon Sep 17 00:00:00 2001 From: dlaw4608 Date: Thu, 15 Aug 2024 16:44:46 +0100 Subject: [PATCH] Fixed Merge Conflicts Signed-off-by: dlaw4608 --- .github/workflows/build-images-base.yaml | 2 +- .github/workflows/build-images-pr.yaml | 29 ++++++++++++++++++++++++ 2 files changed, 30 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 7afa01b5d..451ee32e9 100644 --- a/.github/workflows/build-images-base.yaml +++ b/.github/workflows/build-images-base.yaml @@ -194,4 +194,4 @@ jobs: tags: | ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.OPERATOR_NAME }}-catalog:${{ env.IMG_TAGS }} - name: Print Catalog Image URL - run: echo "Catalog image pushed to ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.OPERATOR_NAME }}-catalog:${{ env.IMG_TAGS }}" \ No newline at end of file + run: echo "Catalog image pushed to ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/${{ env.OPERATOR_NAME }}-catalog:${{ env.IMG_TAGS }}" \ 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..9e6cb4112 --- /dev/null +++ b/.github/workflows/build-images-pr.yaml @@ -0,0 +1,29 @@ +name: PR Conditional Build and Push Image to Quay.io Repo + +on: + pull_request_target: + types: [labeled, opened, synchronize, reopened] + +concurrency: + group: pr-conditional-build-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + workflow-build: + if: ${{ 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 }} + + remove-label: + runs-on: ubuntu-latest + needs: workflow-build + steps: + - name: Remove forked_image_approved label after workflow is triggered + - uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: forked_image_approved + repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file