How to handle the space in secret value in github settings #27113
-
How to handle the space in secret value in github settings, I am getting the below error, by using secret token above format. Getting the issue with space between secret value “Token xxxxxxxxxxx”. Please help me how to handle this scenario. Thank! Unable to find image ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:latest’ locally 43docker: Error response from daemon: pull access denied for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
How are you trying to use that secret? Usually the secret value should only contain the part that’s supposed to be secret, not a prefix like “Token”. |
Beta Was this translation helpful? Give feedback.
-
actually one of the API we are using Authorization value like “Token 7555xxxxxxxx”. I added this value in github setting secrets. And using workflow yml file to load this secret values. |
Beta Was this translation helpful? Give feedback.
-
Basha963:
Do you mean an Authorization HTTP header?
Basha963:
Yes, but exactly how? I assume there’s some step that involves something like
somewhere, and the details of that are important here. |
Beta Was this translation helpful? Give feedback.
-
Yes, it’s authorization HTTP header and I am using secret like below
echo “TEST_PROD_TOKEN =${{ TEST_PROD_TOKEN }}” >> $GITHUB_ENV docker run --rm -v ${PWD}:/app |
Beta Was this translation helpful? Give feedback.
-
Okay, in that case I see three problems here:
So, what you should do:
Note the quotes around the value for |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @airtower-luna for your help. Now I am able to run all my tests without issues. |
Beta Was this translation helpful? Give feedback.
Okay, in that case I see three problems here:
GITHUB_ENV
in the same step that sets it, only steps after.docker run
command contains an unquoted space.So, what you should do:
TEST_PROD_TOKEN
) without the detour viaGITHUB_ENV
: