Skip to content

Commit

Permalink
HACK: jobs and steps conditionals don't support secrets context
Browse files Browse the repository at this point in the history
piranna committed Jan 25, 2024
1 parent 0eb71cd commit 1582792
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -329,15 +329,21 @@ jobs:
# NPM registry
publish-npm-registry:
needs: [check, update]
if: secrets.npm_token != ''
# if: secrets.npm_token != ''
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
# HACK: see https://github.com/actions/runner/issues/520#issuecomment-720508121
- name: has secret
id: has_secret
run: echo '::set-output name=npm_token::${{secrets.npm_token != ''}}'

# Init
- name: init
if: steps.has_secret.outputs.npm_token
uses: Mafalda-SFU/Github-Actions-init@v1
with:
NODE_AUTH_TOKEN: ${{ inputs.node_auth_token || secrets.GITHUB_TOKEN }}
@@ -347,6 +353,7 @@ jobs:

# Publish
- run: npm publish --provenance
if: steps.has_secret.outputs.npm_token
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token || secrets.GITHUB_TOKEN}}

0 comments on commit 1582792

Please sign in to comment.