-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (24 loc) · 1007 Bytes
/
outputsecrets.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
on: push
name: "Output secrets to the log"
jobs:
outputsecrets:
runs-on: ubuntu-latest
steps:
# Note: GitHub automatically replaces outputted secrets in the log with ***. To circumvent this, we output the secret in two parts
- name: Echo secret password
env:
MY_SECRET_PASSWORD: ${{ secrets.MY_SECRET_PASSWORD }}
run: |
echo "MY_SECRET_PASSWORD is ${#MY_SECRET_PASSWORD} characters long."
echo "Part 1: ${MY_SECRET_PASSWORD:0:8}"
echo "Part 2: ${MY_SECRET_PASSWORD:8}"
# Ditto for the multiline secret, we output it line by line.
- name: Echo secret note
env:
MY_SECRET_NOTE: ${{ secrets.MY_SECRET_NOTE }}
run: |
echo "MY_SECRET_NOTE is ${#MY_SECRET_NOTE} characters long and contains $(echo "$MY_SECRET_NOTE" | wc -l) lines."
while IFS= read -r line; do
echo "Part 1: ${line:0:8}"
echo "Part 2: ${line:8}"
done <<< "$MY_SECRET_NOTE"