In page https://learn.microsoft.com/en-us/training/modules/manage-github-actions-enterprise/manage-encrypted-secrets
it states that
Secrets are encrypted environment variables you can create to...
and in knowledge check https://learn.microsoft.com/en-us/training/modules/manage-github-actions-enterprise/knowledge-check
the question "What are encrypted secrets?" is provided with the answer:
Encrypted secrets are encrypted environment variables you can create to store sensitive information.
Both are incorrect. Secrets are variables that are accessed through the secrets context. They are NOT environment variables.
See the official documentation: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
Secrets are variables that you create ...
Notice that is says "variables", not "environment variables".
If you want an environment variable with a secret, you must create such environment variable with an "env" section, define a name for the environment variable and assign to it the value of the secrets context:
steps:
- name: Hello world action
...
env:
super_secret: ${{ secrets.SuperSecret }}
This question is related to the following Learning Module