-
-
Save KyMidd/4ab35d61fb121b46ad32fab2b2d1c722 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Passing variable Jobs v2 (Broken) | |
| on: workflow_dispatch | |
| jobs: | |
| pass-var: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set deploy location | |
| id: set-var | |
| run: | | |
| ENVIRONMENT=dev | |
| echo "The ENVIRONMENT var is: $ENVIRONMENT" | |
| echo "ENVIRONMENT=$ENVIRONMENT" >> $GITHUB_ENV | |
| job2-read-var: | |
| runs-on: ubuntu-latest | |
| needs: pass-var | |
| steps: | |
| - name: Print the deploy location | |
| run: | | |
| if [ -z "$ENVIRONMENT" ]; then | |
| echo "No ENVIRONMENT var set, exiting" | |
| exit 1 | |
| else | |
| echo "The ENVIRONMENT var is set to: $ENVIRONMENT" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment