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

Workflow: PR Conditional Build and Push Image to Quay.io Repo #805

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,4 @@ jobs:
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
- name: Print Image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

29 changes: 29 additions & 0 deletions .github/workflows/build-images-pr.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading