Skip to content

Commit 17fb94c

Browse files
committed
Secrets can't be used in conditionals, apparently
1 parent b7cd98d commit 17fb94c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/code-qa.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ jobs:
4444
run: npm test
4545

4646
integration-test:
47-
if: "${{ secrets.OPENROUTER_API_KEY != '' }}"
47+
# https://stackoverflow.com/questions/72925899/github-actions-detect-if-secret-exists
48+
env:
49+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
50+
if: ${{ env.OPENROUTER_API_KEY != '' }}
4851
strategy:
4952
matrix:
5053
os: [ubuntu-latest] # macos-latest, windows-latest
@@ -59,8 +62,6 @@ jobs:
5962
cache: 'npm'
6063
- name: Create env.integration file
6164
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
62-
- name: Check env.integration file
63-
run: cat .env.integration
6465
- name: Install dependencies
6566
run: npm run install:all
6667
- run: xvfb-run -a npm run test:integration

0 commit comments

Comments
 (0)