Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github actions incorrectly thinks variable is a secret and so does not set outputs

A step in my workflow file will return some IDs of EC2 instances in my aws account and then i set these IDs as a github output to be used in other jobs in my workflow file

I have done this in many workflows and step will return something like this:

["i-0d945b001544f2614","i-0b90ba69d37aad78c"]

However, in one workflow file github is masking the IDs as it thinks it is a secret for some reason, so it will return:

["i-***2d571abc6d7d***4ef","i-***186ce12c5cd8e744"]

Therefore i get this error message on the workflow job summary:

Skip output 'instanceIDs' since it may contain secret.

And so the other jobs in my workflow file that rely on this output will fail as github won't set an output.

I have tried to use base64 as suggested in this post but i haven't been able to get that to work

Is there any other work around?

like image 378
polo Avatar asked Oct 24 '25 08:10

polo


1 Answers

Recently, GitHub released a new feature - configuration variables in workflows.

Configuration variables allow you to store your non sensitive data as plain text variables that can be reused across your workflows in your repository or organization.

You can define variables at Organization, Repository, or Environment level based on your requirement.

These variables are accessible from the workflow by vars context.

Example:

jobs:
  display-variables:
    runs-on: ${{ vars.RUNNER }}
    steps:
    - name: Use variables
      run: |
        echo "Repository variable : ${{ vars.REPOSITORY_VAR }}"
        echo "Organization variable : ${{ vars.ORGANIZATION_VAR }}"

In this example, we have the following configuration variables: RUNNER, REPOSITORY_VAR, ORGANIZATION_VAR. As opposed to the repository secrets, the values of these variables won't be masked.

For more details, see the Defining configuration variables for multiple workflows.

like image 69
Andrii Bodnar Avatar answered Oct 27 '25 00:10

Andrii Bodnar