Add Secrets and Variables to Shipfox Workflows
Choose the right workspace value, bind it to a workflow step, and verify it without exposing a secret.
Use a variable for readable configuration and a secret for a credential. Both are available to projects in the workspace.
Before you begin
You need access to workspace secret and variable settings. To verify a value in a workflow, you also need a project and an online runner.
Create the values
- Open Settings → Variables in the workspace.
- Select Create variable.
- Enter
DEPLOY_TARGETas the key andstagingas the value. - Save the variable.
- Open Settings → Secrets.
- Select Create secret.
- Enter
NPM_TOKENas the key and the token as the value. - Save the secret. Shipfox does not show its value again.
Bind and verify the values
Add this complete workflow to the project:
# yaml-language-server: $schema=https://www.shipfox.io/docs/workflow.schema.json
name: Verify workspace values
runner: ubuntu-latest
triggers:
manual:
source: manual
event: fire
jobs:
check:
steps:
- env:
TARGET: "${{ vars.DEPLOY_TARGET }}"
TOKEN: "${{ secrets.NPM_TOKEN }}"
run: |
test -n "$TOKEN"
printf 'Target: %s\n' "$TARGET"Commit and push the workflow to the project's default branch, then start it from
the Workflows tab. The step must succeed and print Target: staging. It
checks that the token is present without printing the token.
If DEPLOY_TARGET is missing, Shipfox stops run creation. If NPM_TOKEN is
missing, Shipfox fails the step before the command runs. Fix the value in
workspace settings and start a new run. Storage, masking, scope, and supported
binding sites live in Secrets and variables.