Difference between revisions of "Template:Gha outputs"
Jump to navigation
Jump to search
(Created page with " jobs: job1: runs-on: ubuntu-latest # Map a step output to a job output outputs: output1: ${{ steps.step1.outputs.test }} output2:...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | <pre><nowiki> | |
− | + | jobs: | |
job1: | job1: | ||
− | + | runs-on: ubuntu-latest | |
# Map a step output to a job output | # Map a step output to a job output | ||
− | + | outputs: | |
output1: ${{ steps.step1.outputs.test }} | output1: ${{ steps.step1.outputs.test }} | ||
output2: ${{ steps.step2.outputs.test }} | output2: ${{ steps.step2.outputs.test }} | ||
− | + | steps: | |
- id: step1 | - id: step1 | ||
run: echo "test=hello" >> "$GITHUB_OUTPUT" | run: echo "test=hello" >> "$GITHUB_OUTPUT" | ||
Line 20: | Line 20: | ||
OUTPUT2: ${{needs.job1.outputs.output2}} | OUTPUT2: ${{needs.job1.outputs.output2}} | ||
run: echo "$OUTPUT1 $OUTPUT2" | run: echo "$OUTPUT1 $OUTPUT2" | ||
+ | </nowiki> | ||
+ | </pre> |
Latest revision as of 16:01, 23 October 2024
jobs: 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: - id: step1 run: echo "test=hello" >> "$GITHUB_OUTPUT" - id: step2 run: echo "test=world" >> "$GITHUB_OUTPUT" job2: runs-on: ubuntu-latest needs: job1 steps: - env: OUTPUT1: ${{needs.job1.outputs.output1}} OUTPUT2: ${{needs.job1.outputs.output2}} run: echo "$OUTPUT1 $OUTPUT2"
Advertising: