Skip to content

Commit a22165d

Browse files
authored
Update blank.yml
1 parent f9b929f commit a22165d

File tree

1 file changed

+14
-37
lines changed

1 file changed

+14
-37
lines changed

.github/workflows/blank.yml

+14-37
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,23 @@ on:
1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
1515

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1716
jobs:
18-
# This workflow contains a single job called "build"
19-
build:
20-
# The type of runner that the job will run on
17+
job1:
2118
runs-on: ubuntu-latest
19+
# Map a step output to a job output
2220
outputs:
23-
STATE1: ${{ steps.setStateOutput.outputs.STATE1 }}
24-
OUTPUT2: ${{ steps.setStateOutput.outputs.OUTPUT2 }}
25-
26-
# Steps represent a sequence of tasks that will be executed as part of the job
21+
output1: ${{ steps.step1.outputs.test }}
22+
output2: ${{ steps.step2.outputs.test }}
2723
steps:
28-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29-
- uses: actions/checkout@v3
30-
31-
# Runs a single command using the runners shell
32-
- name: Run a one-line script
33-
run: echo Hello, world!
34-
35-
# Runs a set of commands using the runners shell
36-
- name: Run a multi-line script
37-
run: |
38-
echo Add other actions to build,
39-
echo test, and deploy your project.
40-
echo GITHUB_STATE=$GITHUB_STATE
41-
echo GITHUB_OUTPUT=$GITHUB_OUTPUT
42-
43-
# Runs a set of commands using the runners shell
44-
- name: Save state/output
45-
id: setStateOutput
46-
run: |
47-
echo "{STATE1}={VALUE1}" >> $GITHUB_STATE
48-
echo "{OUTPUT2}={VALUE2}" >> $GITHUB_OUTPUT
49-
50-
build2:
24+
- id: step1
25+
run: echo "test=hello" >> "$GITHUB_OUTPUT"
26+
- id: step2
27+
run: echo "test=world" >> "$GITHUB_OUTPUT"
28+
job2:
5129
runs-on: ubuntu-latest
52-
needs: [build]
53-
env:
54-
STATE1: ${{needs.build.outputs.STATE1}}
55-
OUTPUT2: ${{needs.build.outputs.OUTPUT2}}
30+
needs: job1
5631
steps:
57-
- name: Run a one-line script
58-
run: echo $STATE1 $OUTPUT2
32+
- env:
33+
OUTPUT1: ${{needs.job1.outputs.output1}}
34+
OUTPUT2: ${{needs.job1.outputs.output2}}
35+
run: echo "$OUTPUT1 $OUTPUT2"

0 commit comments

Comments
 (0)