Skip to content

Commit

Permalink
Fixed line-breaks, included concurrency, and added job to remove labe…
Browse files Browse the repository at this point in the history
…ls once the workflow has ran
  • Loading branch information
dlaw4608 committed Jul 26, 2024
1 parent 6729b52 commit c0ffb8c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,5 @@ 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 }}"

18 changes: 16 additions & 2 deletions .github/workflows/build-images-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ 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: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'forked_image_approved') }}
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 }}
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
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: forked_image_approved
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c0ffb8c

Please sign in to comment.