Way to fetch value of github secret

Viewed 2186

Is there any way to fetch github secret value and display in workflow or fetch through library or APi or even github portal once it is stored. I just want to validate.

2 Answers

Github Actions replaces secret values in the log, so if you want to view the secret you must change its value first. Like this step:

- name: DISPLAY SECRETS
  run: echo ${{secrets.mysecret}} | sed 's/./& /g'

This will insert a space between each character of the secret, allowing you to see its value.

Related