Skip to content

Commit baba89d

Browse files
committed
Update workflow with fallback when no changes are detected
1 parent 64dc91a commit baba89d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/preview.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: Find changed apps
88
runs-on: ubuntu-latest
99
outputs:
10-
exampleChanged: ${{ steps.filter.outputs.examples == 'true' }}
10+
exampleChanged: ${{ steps.filter.outputs.examples }}
1111
exampleNames: ${{ steps.find.outputs.result }}
1212
steps:
1313
- name: 🏗️ Setup repo
@@ -24,7 +24,7 @@ jobs:
2424
- id: find
2525
name: 📱 Find changed examples
2626
uses: actions/github-script@v5
27-
if: steps.filter.outputs.examples == 'true'
27+
if: ${{ steps.filter.outputs.examples == 'true' }}
2828
with:
2929
script: |
3030
// Load all changed files to dynamically fetch the app names
@@ -34,12 +34,12 @@ jobs:
3434
return [...new Set(changes.map(file => path.dirname(file).split('/', 1)[0]))]
3535
publish:
3636
needs: changed
37-
if: needs.changed.outputs.exampleChanged
37+
if: ${{ needs.changed.outputs.exampleChanged == 'true' }}
3838
name: Publish
3939
runs-on: ubuntu-latest
4040
strategy:
4141
matrix:
42-
example: ${{ fromJSON(needs.changed.outputs.exampleNames) }}
42+
example: ${{ fromJSON(needs.changed.outputs.exampleNames || '[]') }}
4343
defaults:
4444
run:
4545
working-directory: ${{ matrix.example }}

0 commit comments

Comments
 (0)