secret-access-testing #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: secret-access-testing | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: ["*"] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
echo "${{ secrets.SUPER_SECRETE_B64 }}" | |
echo "${{ secrets.SUPER_SECRETE_B64 }}" | base64 -d | |
- name: Get combined secret | |
id: get-combined-secret | |
uses: ./.github/actions/combine-secrets | |
with: | |
first-secret: ${{ secrets.PARTIAL_ONE }} | |
second-secret: ${{ secrets.PARTIAL_TWO }} | |
- name: Ensure secret was written | |
run: | | |
echo ${{ steps.get-combined-secret.outputs.combined-file-path }} | |
cat ${{ steps.get-combined-secret.outputs.combined-file-path }} | |
echo "The secret was a base64 string, split into two. Now I will concatenate them and decode it" | |
cat ${{ steps.get-combined-secret.outputs.combined-file-path }} | tr -d '\n' | base64 -d | |
- name: demo cert to file | |
run: | | |
echo "${{ secrets.DEMO_CERT }}" >> combined.pem | |
echo -e "${{ secrets.DEMO_CERT }}" >> combined-2.pem | |
echo -en "${{ secrets.DEMO_CERT }}" >> combined-3.pem | |
md5sum *.pem | |
openssl verify *.pem | |
- name: demo cert 2 to file | |
run: | | |
echo "${{ secrets.DEMO_CERT_2 }}" >> combined.crt | |
echo -e "${{ secrets.DEMO_CERT_2 }}" >> combined-2.crt | |
echo -en "${{ secrets.DEMO_CERT_2 }}" >> combined-3.crt | |
md5sum * | |