Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
REBELinBLUE
3 years agoOccasional Contributor
Not overwriting existing environment variables
Can someone tell me what I am doing wrong here
According to https://developer.1password.com/docs/cli/reference/commands/run
Duplicate environment variables​
If the same environment variable...
Nhat_Nguyen
1Password Team
3 years agoHello REBELinBLUE,
Thank you for reaching out to us. I can reproduce the issue on my end, and 1Password does use the variable in shell instead of .env
file. I will report it to my team for further investigation. In the meantime, we can try some of these options to get the correct env we want.
- You can edit the name of GITHUB_TOKEN in .env file to something different and run
op run --account=[account id] --env-file="./.env" -- printenv NEW-VAR-NAME
- You can unset GITHUB_TOKEN, and add both GITHUB_TOKEN to
.env
file with different names, or you can create a new file with .env extension. Let us call ittoken2
as an example and put the old value there so when you need to run it, you can useop run --account=[account id] --env-file="./token2.env" -- printenv GITHUB_TOKEN
Best regards,
Nhat Nguyen.