Skip to content

Commit c4d7f8d

Browse files
committed
fix(cicd): move condition check for build in reusable workflow
1 parent a537dc0 commit c4d7f8d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/build-push-container.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ on:
1818
jobs:
1919
container-build:
2020
name: Build ${{ inputs.container_name }} ${{ matrix.architecture }}
21+
if: >
22+
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'cicd:movement-containers')
23+
|| github.ref == 'refs/heads/main'
24+
|| startsWith(github.ref, 'refs/tags/')
2125
strategy:
2226
matrix:
2327
architecture: [x86_64, arm64]
2428
runs-on: ${{ matrix.architecture == 'x86_64' && 'buildjet-16vcpu-ubuntu-2204' || 'buildjet-16vcpu-ubuntu-2204-arm' }}
2529
steps:
30+
2631
- name: Checkout repository
2732
uses: actions/checkout@v4
2833
with:

.github/workflows/build-push-containers-all.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ jobs:
2929
echo "${GITHUB_CONTEXT}"
3030
3131
build-push-checked-containers:
32-
if: >
33-
contains(github.event.pull_request.labels.*.name, 'cicd:movement-containers')
34-
|| github.ref == 'refs/heads/main'
35-
|| github.event.label.name == 'cicd:movement-containers'
36-
|| startsWith(github.ref, 'refs/tags/')
32+
3733

3834
uses: ./.github/workflows/build-push-container.yml
3935
name: Build Push Checked Containers

0 commit comments

Comments
 (0)