Skip to content

Github Actions Mask Expression #26032

Answered by BrightRan
ugam-paul asked this question in Actions
Discussion options

You must be logged in to vote

@ugam-paul ,

The following workaround should work:

  • Add the command lines you need to execute in a bash script file (e.g. mask.sh).

  • Execute the bash script in your workflow.

    - name: mask secret
      id: mask
      run: |
        chmod +x ./mask.sh
        ./mask.sh
    

When “run” a bash script file, the command lines in the script file will not be printed in the logs.

Here is a example I tested on my side:

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants