question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combining job outputs with masking leads to empty output

See original GitHub issue

Describe the bug

When combining job outputs with masking the output is empty when used in another job.

To Reproduce Steps to reproduce the behavior:

name: Repro
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
jobs:
  setup:
    name: Setup
    runs-on: ubuntu-latest
    outputs:
      secret: ${{ steps.setup-secret.outputs.secret }}
    steps:
        - name: Setup secret
          id: setup-secret
          shell: pwsh
          run: |
            $secret = "SuperSecret"
            echo "::add-mask::$secret"
            echo "::set-output name=secret::$secret"
  build:
    name: Build
    runs-on: ubuntu-latest
    needs: setup
    steps:
      - name: Run tests
        shell: pwsh
        env:
          SomeEnv: ${{ needs.prepare.outputs.secret}}          
        run: echo ${{ needs.prepare.outputs.secret}} 

Expected behavior

Secret should be available, not empty and masked

Runner Version and Platform

Version of your runner? Current runner version: ‘2.284.0’

OS of the machine running the runner? Linux

What’s not working?

Please include error messages and screenshots.

Job Log Output

Run echo 
  echo 
  shell: /usr/bin/pwsh -command ". '{0}'"
  env:
    SomeEnv: 

cmdlet Write-Output at command pipeline position 1
Supply values for the following parameters:
InputObject: 
Write-Output: /home/runner/work/_temp/a307241a-4c46-4240-9ab0-e317d0006971.ps1:2
Line |
   2 |  echo
     |  ~~~~
     | Cannot process command because of one or more missing
     | mandatory parameters: InputObject.

Error: Process completed with exit code 1.

https://github.com/danielmarbach/GithubActionsWorkflowSharingSpike/runs/4258032273?check_suite_focus=true

Runner and Worker’s Diagnostic Logs

If applicable, add relevant diagnostic log information. Logs are located in the runner’s _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
zacharykeetoncommented, Mar 10, 2023

Not only secrets, but anything, if masked, cannot be referenced into another job:

e.g. when I use amazon-ecr-login get a registry in outputs, https://github.com/marketplace/actions/amazon-ecr-login-action-for-github-actions

      REGISTRY: ${{ steps.login-ecr.outputs.registry }}
outputs:
    registry: ${{ steps.login-ecr.outputs.registry }}

but if I define the registry into output for another job to use, the full registry string is masked like this:

Logging into registry ***.dkr.ecr.ap-southeast-1.amazonaws.com

in another job, use it with jobs.job_id.outputs.registry it got empty

this is a BUG, not only enhancement request in community/community#13082

Suffering the same aws troubles, I found this thread. Later, I found the answer. Returning here to post what I found:

see with: mask-aws-account-id: 'false' in the amazon-ecr-login action https://github.com/aws-actions/amazon-ecr-login

3reactions
danielmarbachcommented, Mar 20, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

cloudposse/github-action-secret-outputs: Allow to pass a ...
Combining job outputs with masking leads to empty output - When combining job outputs with masking the output is empty when used in...
Read more >
GitHub Actions Set Output - Assure Parallel Job Access is ...
Currently, there is no easy way to reference all outputs of matrix jobs. Moreover combining it into a single output.
Read more >
$P O Job - Purge a job's output
The job was cancelled (flushed) and is no longer eligible to run. JCLerror: Specify jobs which did not execute due to a JCL...
Read more >
What is Data Masking? Techniques, Types and Best ...
Encrypted data can be decrypted and returned to its original state with the correct encryption key. With masked data, there is no algorithm...
Read more >
Preparing Manufacturing Data with Output Jobs in ...
Multiple outputs can be streamed into a single output file if required ... Output Job files, when added to a project, appear in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found