githubgithub-actions

How to print the sensitive information in workflow log when debug script?


I am debugging the GitHub workflow YAML and want to print some variables, which got via some commands, so that I can double check the values, but when I try to echo the variables the output is *** in the workflow log.

Is there any approach to print the sensitive information in workflow log?


Solution

  • An idear come from https://stackoverflow.com/a/72881741/7670262

        run: |
            echo ${{secrets.AWS_ACCESS_KEY_ID}} | sed 's/./& /g'
    

    Run this action in GitHub and check its console. It displays secret key with space between each character.