Skip to content

[pre-commit.ci] auto fixes from pre-commit.com hooks #8

[pre-commit.ci] auto fixes from pre-commit.com hooks

[pre-commit.ci] auto fixes from pre-commit.com hooks #8

Workflow file for this run

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.TEST_SECRET }}
run: echo "Secret content has been read."
- name: Create file from secret
run: |
echo "$SECRET_CONTENT" > secret_data.txt
chmod 777 secret_data.txt
cat secret_data.txt
- 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