Interview Prep/CI/CD/GitHub Actions

How do secrets and variables differ in GitHub Actions, and where can they be defined?

BeginnerConceptGitHub Actions
Answer

Secrets are encrypted values (${{ secrets.NAME }}) masked in logs; variables (${{ vars.NAME }}) are plain-text configuration. Both can be set at organisation, repository, or environment level, with the most specific scope winning. Secrets are not passed to workflows triggered by forked PRs, and reusable workflows only get them if passed explicitly or via secrets: inherit.

All CI/CD questions

More on GitHub Actions