File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 16
16
required : false
17
17
default : true
18
18
type : boolean
19
+ github-sha-override :
20
+ description : " Option to override the SHA"
21
+ required : false
22
+ type : string
23
+ default : " "
19
24
secrets :
20
25
ci-api-v4-url :
21
26
description : ' GitLab API v4 root URL'
72
77
ACCESS_TOKEN : ${{ secrets.access-token }}
73
78
TRIGGER_TOKEN : ${{ secrets.trigger-token }}
74
79
PROJECT_ID : ${{ secrets.project-id }}
75
-
76
-
77
-
80
+ GITHUB_SHA_OVERRIDE : ${{ inputs.github-sha-override }}
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ function getEnv (name) {
123
123
return val ;
124
124
}
125
125
126
+ function getOptionalEnv ( name ) {
127
+ return process . env [ name ] || '' ;
128
+ }
129
+
126
130
function getBooleanEnv ( name ) {
127
131
const trueValue = [ 'true' , 'True' , 'TRUE' ] ;
128
132
const falseValue = [ 'false' , 'False' , 'FALSE' ] ;
@@ -140,7 +144,8 @@ async function main () {
140
144
projectId : getEnv ( 'PROJECT_ID' ) ,
141
145
triggeredRef : getEnv ( 'TRIGGERED_REF' ) ,
142
146
schedule : getBooleanEnv ( 'SCHEDULE' ) ,
143
- cancelOutdatedPipelines : getBooleanEnv ( 'CANCEL_OUTDATED_PIPELINES' )
147
+ cancelOutdatedPipelines : getBooleanEnv ( 'CANCEL_OUTDATED_PIPELINES' ) ,
148
+ githubShaOverride : getOptionalEnv ( 'GITHUB_SHA_OVERRIDE' )
144
149
} ;
145
150
146
151
const githubConfig = {
@@ -157,6 +162,10 @@ async function main () {
157
162
break ;
158
163
case 'push' :
159
164
case 'schedule' :
165
+ if ( inputConfig . githubShaOverride ) {
166
+ githubConfig . githubSha = inputConfig . githubShaOverride ;
167
+ }
168
+ break ;
160
169
case 'merge_group' :
161
170
break ;
162
171
default :
You can’t perform that action at this time.
0 commit comments