Skip to content

Commit 511dece

Browse files
committed
Refactor conditional logic for deployment triggers in CI workflow
1 parent 2a858c2 commit 511dece

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
outputs:
247247
image_tag: ${{ github.run_number }} # output the image tag to be used in the build-and-publish-docker-image job
248248
needs: [build, test] # depend on the build job to get the published app artifact
249-
if: ${{ github.event.inputs.full_pipeline && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request_target' && github.base_ref == 'main' && github.head_ref == 'develop')) }}
249+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.full_pipeline && github.ref == 'refs/heads/main') }}
250250
permissions:
251251
packages: write
252252
id-token: write
@@ -283,7 +283,7 @@ jobs:
283283

284284
deploy:
285285
needs: [build-and-publish-docker-image] # this job needs build-and-publish-docker-image job as a requirement to run
286-
if: ${{ github.event.inputs.full_pipeline }}
286+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.full_pipeline && github.ref == 'refs/heads/main') }}
287287
uses: ./.github/workflows/cd.yml
288288
with:
289289
# with tag from the build-and-publish-docker-image job in the output_tags step

0 commit comments

Comments
 (0)