Skip to content
31 linesCodeBlameRaw
1name: Greet (reusable)
2on:
3 workflow_call:
4 inputs:
5 who:
6 type: string
7 required: true
8 loud:
9 type: boolean
10 default: false
11 outputs:
12 message:
13 description: What was said
14 value: ${{ jobs.say.outputs.said }}
15jobs:
16 say:
17 runs-on: ubuntu-latest
18 outputs:
19 said: ${{ steps.greet.outputs.said }}
20 steps:
21 - id: greet
22 run: |
23 msg="hello, ${{ inputs.who }}"
24 if [ "${{ inputs.loud }}" = "true" ]; then msg="${msg^^}!"; fi
25 echo "$msg"
26 echo "said=$msg" >> "$GITHUB_OUTPUT"
27 after:
28 needs: say
29 runs-on: ubuntu-latest
30 steps:
31 - run: echo "the greeting was ${{ needs.say.outputs.said }}"