Skip to content

Commit

Permalink
Update environments-secrets.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jumainfomagnus authored Jun 14, 2024
1 parent bdb347d commit ed8e2f8
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/environments-secrets.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: 03-1. Environments and Secrets

on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

# Limit the permissions of the GITHUB_TOKEN
permissions:
Expand All @@ -19,6 +19,23 @@ env:
DEV_URL: 'https://docs.github.com/en/developers'

jobs:
use-secrets:
name: Use secrets
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- name: Hello world action with secrets
uses: actions/hello-world-javascript-action@main
with: # Set the secret as an input
who-to-greet: ${{ secrets.MY_REPO_SECRET }}
env: # Or as an environment variable
super_secret: ${{ secrets.MY_REPO_SECRET }}
- name: Echo secret is redacted in the logs
run: |
echo Env secret is ${{ secrets.MY_REPO_SECRET }}
echo Warning: GitHub automatically redacts secrets printed to the log,
echo but you should avoid printing secrets to the log intentionally.
echo ${{ secrets.MY_REPO_SECRET }} | sed 's/./& /g'
use-environment-dev:
name: Use DEV environment
runs-on: ubuntu-latest
Expand Down

0 comments on commit ed8e2f8

Please sign in to comment.