Skip to content

How to handle the space in secret value in github settings #27113

Answered by airtower-luna
Basha963 asked this question in Actions
Discussion options

You must be logged in to vote

Okay, in that case I see three problems here:

  1. Having “Token” as part of the secret. That can cause trouble with masking secrets in the logs, and the documentation warns against it.
  2. You can’t use an environment value written to GITHUB_ENV in the same step that sets it, only steps after.
  3. The docker run command contains an unquoted space.

So, what you should do:

  1. Remove the “Token” part from your secret. The value should only be the “7555xxxxxxxx” part.
  2. You can then use it in your workflow like this (assuming the secret is also called TEST_PROD_TOKEN) without the detour via GITHUB_ENV:
- name: run docker with token
  run: |
    docker run --rm -v ${PWD}:/app --env="TEST_PROD_TOKEN=Token $…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants