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.
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.
There is no way to actually display the github secret value but there are ways to validate eg you can use if: {{secret_name}} == 'release' , then do this else do that. Reference for writing if condition in github workflow: https://github.blog/changelog/2019-10-01-github-actions-new-workflow-syntax-features/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With