Environment variables for inputs of custom actions use the "INPUT_" prefix

Carlos Quintero 100 Reputation points
2024-07-13T15:34:07.3966667+00:00

In this page:

https://learn.microsoft.com/en-us/training/modules/manage-github-actions-enterprise/manage-encrypted-secrets

if appears this:

inputs:
  super_secret:
    description: 'My secret token'
    required: true

If you need to access the encrypted secret in your action's code, the action code could read the value of the input using the $SUPER_SECRET environment variable.

That is incorrect. The environment variable that GitHub Actions create for the input of an action uses the prefix "INPUT_", so it should be "$INPUT_SUPER_SECRET". See: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs

This question is related to the following Learning Module

GitHub Training
GitHub Training
GitHub: A web-based hosting service for software development and version control using Git. Acquired by Microsoft in 2018.Training: Instruction to develop new skills.
29 questions
0 comments No comments
{count} votes