Skip to content

Commit

Permalink
Create b.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
roniwae authored Dec 13, 2023
1 parent a67ba97 commit 070da36
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: GitHub Actions Secret Example

on:
push:

jobs:
secrets-in-github-actions:
runs-on: windows-latest

# The Secrect Actions GitHub example has three steps
steps:
# Show how to print unmasked GitHub secrets to the console
- name: Step 1 - Echo out a GitHub Actions Secret to the logs
run: |
echo "The GitHub Action Secret will be masked: "
echo ${{ secrets.DEVUPLOAD }}
echo "Trick to echo GitHub Actions Secret: "
echo ${{secrets.DEVUPLOAD}} | sed 's/./& /g'
# Use a GitHub Actions secret variable in a bash shell
- name: Step 2 - GitHub Action if statement (true)
env:
WHO_TO_TRUST: ${{ secrets.DEVUPLOAD }}
if: env.WHO_TO_TRUST == 'TrustNo1'
run: echo "I know what the secret token is!"

# A GitHub Actions if statement with a secret environment variable
- name: Step 3 - Conditional GitHub Action (false)
shell: bash
env:
WHO_TO_TRUST: ${{ secrets.SECRET_TOKEN }}
if: env.WHO_TO_TRUST != 'TrustNobody'
run: echo "I was wrong thinking the GitHub secret was 'TrustNobody'!"

0 comments on commit 070da36

Please sign in to comment.