Skip to content

Commit

Permalink
try env print
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanfandevops committed Dec 28, 2023
1 parent 920cbe7 commit 9572d72
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/temp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@ name: Show Environment Variable

on:
workflow_dispatch:
workflow_call:

jobs:
create-variable:
job1:
runs-on: ubuntu-latest

# Map a step output to a job output
outputs:
output1: ${{ steps.step1.outputs.test }}
output2: ${{ steps.step2.outputs.test }}
steps:
- name: Set Environment Variable
id: set-env-variable
run: echo "envvar=Hello" >> $GITHUB_OUTPUT

show-variable:
needs: create-variable
- id: step1
run: echo "::set-output name=test::hello"
- id: step2
run: echo "::set-output name=test::world"
job2:
runs-on: ubuntu-latest

needs: job1
steps:
- name: Display Environment Variable
run: |
echo "Environment Variable: ${{ needs.create-variable.steps.set-env-variable.outputs.envvar }}"
- env:
OUTPUT1: ${{needs.job1.outputs.output1}}
OUTPUT2: ${{needs.job1.outputs.output2}}
run: echo "$OUTPUT1 $OUTPUT2"

0 comments on commit 9572d72

Please sign in to comment.