debug Github secrets
April 25, 2024
To print your secrets and prevent the ***
use:
run: echo ${{secrets.YOUR_SECRET }} | sed 's/./& /g'
or if you have them already in a file:
- name: Get head (debug)
run: |
echo $(head /file/with/secrets) | sed 's/./& /g'
This will separate each character by an space and print it and allow you to debug your secrets.:
.
The dot (.) represents any single character in regular expressions.&
In the replacement part of the expression, & represents the matched pattern. So, in this case, it represents each character matched by.
.