File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Testing Github Actions Workflow
2+
3+ on : [pull_request]
4+
5+ jobs :
6+ test :
7+ name : Testing Github Actions Job
8+ env :
9+ CHOSEN_ENVIRONMENT : env1
10+ FOO : ${{ secrets.FOO }}
11+ BAR : ${{ secrets.BAR }}
12+ environment : ${{ env.CHOSEN_ENVIRONMENT }}
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+
17+ - name : Check env vars
18+ run : |
19+ echo "env.FOO == ${{ env.FOO }}"
20+ echo "env.BAR == ${{ env.BAR }}"
21+ echo "env.CHOSEN_ENVIRONMENT == ${{ env.CHOSEN_ENVIRONMENT }}"
22+
23+ - name : This should run
24+ if : ${{ env.FOO == 'foo1' }}
25+ run : echo "env.FOO == 'foo1' -> ${{ env.FOO }} -> ${{ env.FOO == 'foo1' }} -> you will see this"
26+
27+ - name : This should not run
28+ if : ${{ env.FOO == 'foo2' }}
29+ run : echo "env.FOO == 'foo2' -> ${{ env.FOO }} -> ${{ env.FOO == 'foo2' }} -> you will not see this"
30+
You can’t perform that action at this time.
0 commit comments