-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (75 loc) · 2.06 KB
/
worker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Worker
on:
workflow_call:
inputs:
boolean:
description: 'A boolean input'
default: true
required: true
type: boolean
number:
description: 'A number input'
default: 0
required: true
type: number
string:
description: 'A string input'
default: 'foo'
required: true
type: string
optional:
description: 'An optional input'
default: 'fallback'
required: false
type: string
outputs:
workflow_output1:
description: "The first job output"
value: ${{ jobs.output.outputs.one }}
workflow_output2:
description: "The second job output"
value: ${{ jobs.output.outputs.two }}
secrets:
token:
description: 'A token passed from the caller workflow'
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/context
secret:
env:
github_secret: ${{ github.event.workflow_call.secrets.token }}
secret: ${{ secrets.token }}
runs-on: ubuntu-latest
steps:
- shell: bash
run: |
set -x
echo "secrets.token ${{ secrets.token }}"
echo "env.secret: ${{ env.secret }}"
echo "contains(env, 'secret'): ${{ contains(env, 'secret') }}"
echo "env.github_secret: ${{ env.github_secret }}"
echo "contains(env, 'github_secret'): ${{ contains(env, 'github_secret') }}"
output:
runs-on: ubuntu-latest
outputs:
one: ${{ steps.output.outputs.big }}
two: ${{ steps.test.outcome }}
steps:
- uses: actions/checkout@v4
- id: output
shell: bash
run: |
echo "big=${{ inputs.number > 10 }}" >> $GITHUB_OUTPUT
- id: test
shell: bash
run: |
if [[ "${{ inputs.boolean }}" == 'true' ]]; then
exit 1
fi