Skip to content

Commit 5a7f4ce

Browse files
authored
working workflow, individually check for the existence of secrets (#191)
* Update build-and-test.yml Testing for secrets individually * test push * remove fetch-depth
1 parent 6431c7f commit 5a7f4ce

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/build-and-test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ on:
88
jobs:
99
build-and-test:
1010
runs-on: ubuntu-latest
11+
12+
env:
13+
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
14+
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
15+
1116
steps:
1217
- uses: actions/checkout@v2
13-
with:
14-
fetch-depth: 0
1518

1619
- uses: actions/[email protected]
1720

@@ -25,12 +28,13 @@ jobs:
2528
run: npm run build
2629

2730
- name: Publish to Chromatic
28-
if: github.event_name != 'pull_request'
31+
if: env.CHROMATIC_PROJECT_TOKEN != ''
2932
uses: chromaui/action@v1
3033
with:
31-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
34+
projectToken: ${{ env.CHROMATIC_PROJECT_TOKEN }}
3235

3336
- name: Run Fossa and upload data
37+
if: env.FOSSA_API_KEY != ''
3438
uses: fossa-contrib/fossa-action@v1
3539
with:
36-
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
40+
fossa-api-key: ${{ env.FOSSA_API_KEY }}

0 commit comments

Comments
 (0)