4
4
workflow_dispatch :
5
5
inputs :
6
6
commit_sha :
7
- # read more about contexts: https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts
8
- default : ${{ github.sha }}
9
7
required : false
10
8
type : string
11
9
description : " Commit SHA (optional)"
12
10
13
11
workflow_call :
14
12
inputs :
15
13
commit_sha :
16
- default : ${{ github.sha }}
17
14
required : false
18
15
type : string
19
16
@@ -34,15 +31,25 @@ jobs:
34
31
- name : Print environment variables
35
32
run : printenv
36
33
37
- - name : Checkout repository
38
- uses : actions/checkout@v3
34
+ - name : Set up commit SHA
35
+ # "You can make an environment variable available to any subsequent steps in a workflow job by
36
+ # defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
37
+ run : |
38
+ if [ ${{ github.event.inputs.commit_sha }} != "" ]
39
+ then
40
+ echo COMMIT_SHA="${{ github.event.inputs.commit_sha }}" >> $GITHUB_ENV
41
+ else
42
+ echo COMMIT_SHA="${{ github.sha }}" >> $GITHUB_ENV
43
+ fi
44
+ # read more about contexts: https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts
45
+ - uses : actions/checkout@v3
39
46
with :
40
- ref : ${{ github.event.inputs.commit_sha }}
47
+ ref : ${{ env.COMMIT_SHA }}
41
48
42
49
- id : set-matrix
43
50
name : Read and print config from framework-tests-matrix.json
44
51
run : |
45
- TASKS=$(cat .github/workflows/framework-tests-matrix.json)
52
+ TASKS=$(echo $( cat .github/workflows/framework-tests-matrix.json) )
46
53
echo "::set-output name=matrix::$TASKS"
47
54
echo $TASKS
48
55
framework :
@@ -61,10 +68,21 @@ jobs:
61
68
steps :
62
69
- name : Print environment variables
63
70
run : printenv
64
-
71
+
72
+ - name : Set up commit SHA
73
+ # "You can make an environment variable available to any subsequent steps in a workflow job by
74
+ # defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
75
+ run : |
76
+ if [ ${{ github.event.inputs.commit_sha }} != "" ]
77
+ then
78
+ echo COMMIT_SHA="${{ github.event.inputs.commit_sha }}" >> $GITHUB_ENV
79
+ else
80
+ echo COMMIT_SHA="${{ github.sha }}" >> $GITHUB_ENV
81
+ fi
82
+ # read more about contexts: https://docs.github.com/en/actions/learn-github-actions/contexts#about-contexts
65
83
- uses : actions/checkout@v3
66
84
with :
67
- ref : ${{ github.event.inputs.commit_sha }}
85
+ ref : ${{ env.COMMIT_SHA }}
68
86
69
87
- name : Run monitoring
70
88
run : |
@@ -111,10 +129,20 @@ jobs:
111
129
steps :
112
130
- name : Print environment variables
113
131
run : printenv
114
-
132
+
133
+ - name : Set up commit SHA
134
+ # "You can make an environment variable available to any subsequent steps in a workflow job by
135
+ # defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
136
+ run : |
137
+ if [ ${{ github.event.inputs.commit_sha }} != "" ]
138
+ then
139
+ echo COMMIT_SHA="${{ github.event.inputs.commit_sha }}" >> $GITHUB_ENV
140
+ else
141
+ echo COMMIT_SHA="${{ github.sha }}" >> $GITHUB_ENV
142
+ fi
115
143
- uses : actions/checkout@v3
116
144
with :
117
- ref : ${{ github.event.inputs.commit_sha }}
145
+ ref : ${{ env.COMMIT_SHA }}
118
146
119
147
- name : Run monitoring
120
148
run : |
0 commit comments