-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (25 loc) · 1.03 KB
/
test.yml
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
28
29
30
31
name: Read Secret, Create File, and Verify (No Secret Printing)
on:
push:
jobs:
verify_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read secret (content won't be shown in logs)
env:
SECRET_CONTENT: ${{ secrets.YOUR_SECRET_NAME }} # Replace with your secret name
run: echo "Secret content has been read." # Optional success message
- name: Create file from secret
run: |
echo "$SECRET_CONTENT" > secret_data.txt # Replace with desired filename
chmod 600 secret_data.txt # Set file permissions (optional)
- name: Verify file creation (without revealing content)
run: |
# Check if the file exists and has expected size
if [[ -f secret_data.txt && $(wc -c < secret_data.txt) -gt 0 ]]; then
echo "File 'secret_data.txt' created successfully."
else
echo "Error: File creation failed or empty."
exit 1 # Fail the workflow if file creation has issues
fi