Skip to content

Commit 9b7ecfe

Browse files
committed
env.MY_VARIABLE
1 parent 31f74de commit 9b7ecfe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/1.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: First Workflow
22

33
on:
44
workflow_dispatch:
5-
5+
env:
6+
MY_VARIABLE: "Hello from workflow"
67
jobs:
78
job1:
89
runs-on: ubuntu-latest
@@ -18,11 +19,11 @@ jobs:
1819
needs: job1
1920
steps:
2021
- name: Echo phrase for job2
21-
run: echo "This is job2 and MY_VARIABLE is ${{ needs.job1.outputs.MY_VARIABLE }}"
22+
run: echo "This is job2 and MY_VARIABLE is ${{ env.MY_VARIABLE }}"
2223
env:
23-
MY_VARIABLE: ${{ needs.job1.outputs.MY_VARIABLE }}
24+
MY_VARIABLE: ${{ env.MY_VARIABLE }}
2425
- name: Cowsays
2526
uses: mscoutermarsh/cowsays-action@master
2627
with:
27-
text: 'Ready for prod--hsip it! and MY_VARIABLE is ${{ needs.job1.outputs.MY_VARIABLE }}'
28+
text: 'Ready for prod--hsip it! and MY_VARIABLE is ${{ env.MY_VARIABLE }}'
2829
color: 'magenta'

0 commit comments

Comments
 (0)