Skip to content

Commit 43e097f

Browse files
committed
Fix workflow_dispatch support in CI/CD workflows
The workflow_dispatch trigger was not working properly because the changes detection jobs would not detect any file changes during manual runs, causing conditional jobs to be skipped. Changes: - cloudflare-worker.yml: - validate-festivals: Run on workflow_dispatch or when festivals.json changes - deploy-worker: Run on workflow_dispatch or when relevant files change - Validation step in deploy-worker: Always validate on manual triggers - build-deploy.yml: - test: Run on workflow_dispatch or when app files change - deploy-web-preview: Run on workflow_dispatch or when app files change This allows manual workflow triggers to function correctly while maintaining the optimized automatic triggering based on file changes.
1 parent ec2172e commit 43e097f

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/build-deploy.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
test:
4747
needs: changes
4848
runs-on: ubuntu-latest
49-
if: needs.changes.outputs.app == 'true'
49+
if: |
50+
github.event_name == 'workflow_dispatch' ||
51+
needs.changes.outputs.app == 'true'
5052
steps:
5153
- name: Checkout
5254
uses: actions/checkout@v4
@@ -209,7 +211,9 @@ jobs:
209211
deploy-web-preview:
210212
needs: [changes, build-web]
211213
runs-on: ubuntu-latest
212-
if: needs.changes.outputs.app == 'true'
214+
if: |
215+
github.event_name == 'workflow_dispatch' ||
216+
needs.changes.outputs.app == 'true'
213217
steps:
214218
- name: Download build artifact
215219
uses: actions/download-artifact@v4

.github/workflows/cloudflare-worker.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
validate-festivals:
4949
needs: changes
5050
runs-on: ubuntu-latest
51-
if: needs.changes.outputs.festivals == 'true'
51+
if: |
52+
github.event_name == 'workflow_dispatch' ||
53+
needs.changes.outputs.festivals == 'true'
5254
steps:
5355
- name: Checkout
5456
uses: actions/checkout@v4
@@ -104,7 +106,9 @@ jobs:
104106
runs-on: ubuntu-latest
105107
if: |
106108
github.ref == 'refs/heads/main' &&
107-
(needs.changes.outputs.worker == 'true' || needs.changes.outputs.festivals == 'true')
109+
(github.event_name == 'workflow_dispatch' ||
110+
needs.changes.outputs.worker == 'true' ||
111+
needs.changes.outputs.festivals == 'true')
108112
steps:
109113
- name: Checkout
110114
uses: actions/checkout@v4
@@ -115,7 +119,9 @@ jobs:
115119
node-version: '20'
116120

117121
- name: Validate festivals.json
118-
if: needs.changes.outputs.festivals == 'true'
122+
if: |
123+
github.event_name == 'workflow_dispatch' ||
124+
needs.changes.outputs.festivals == 'true'
119125
run: |
120126
cd scripts && npm ci
121127
node validate-festivals.js

0 commit comments

Comments
 (0)