Today I Learned
I always assumed it was possible to pass secrets github actions, but I never really dove into it until now. So today I learned how to add secrets to github for use in the CI/CD for testing. I’m using it with nbdev
How to
- In your repository go to Settings -> Secrets -> Add New Secret and add your secret
- Add to your
workflow.yml
file
env:
key: ${{ secrets.your_secret_key }}
- Access in code as a normal environment variable
import os
= os.environ['your_secret_key'] your_secret_key