Skip to content

Instantly share code, notes, and snippets.

@efossas
Created July 4, 2022 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save efossas/1cad226140f86a30b357732084f2fa41 to your computer and use it in GitHub Desktop.
Save efossas/1cad226140f86a30b357732084f2fa41 to your computer and use it in GitHub Desktop.
Github Actions Share Environment Variable
jobs:
setup-env:
runs-on: ubuntu-latest
steps:
- id: setup-env
# pass secret in as input
with:
MY_SECRET: ${{ secrets.MY_SECRET }}
# or pass in secret as environment variable
env:
MY_SECRET: ${{ secrets.MY_SECRET }}
run: |
echo "MY_SECRET=$MY_SECRET" >> $GITHUB_ENV;
execute:
runs-on: ubuntu-latest
steps:
- run: |
echo "$MY_SECRET";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment