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

Carlos Quintero 245 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.
47 questions
{count} votes

Accepted answer
  1. Rakesh Gurram 9,060 Reputation points Microsoft Vendor
    2024-10-03T11:41:17.7766667+00:00

    Hi Carlos Quintero,

    Thanks for bringing this to our notice.

    Our team is aware of this issue and is actively working on a solution.

    In the meantime, we ask that you complete the Learning Paths without the exercise modules. We will provide updates as soon as we have more information.

    Thank you for your patience and understanding.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.