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 1616 required : false
1717 default : true
1818 type : boolean
19+ github-sha-override :
20+ description : " Option to override the SHA"
21+ required : false
22+ type : string
23+ default : " "
1924 secrets :
2025 ci-api-v4-url :
2126 description : ' GitLab API v4 root URL'
7277 ACCESS_TOKEN : ${{ secrets.access-token }}
7378 TRIGGER_TOKEN : ${{ secrets.trigger-token }}
7479 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) {
123123 return val ;
124124}
125125
126+ function getOptionalEnv ( name ) {
127+ return process . env [ name ] || '' ;
128+ }
129+
126130function getBooleanEnv ( name ) {
127131 const trueValue = [ 'true' , 'True' , 'TRUE' ] ;
128132 const falseValue = [ 'false' , 'False' , 'FALSE' ] ;
@@ -140,7 +144,8 @@ async function main () {
140144 projectId : getEnv ( 'PROJECT_ID' ) ,
141145 triggeredRef : getEnv ( 'TRIGGERED_REF' ) ,
142146 schedule : getBooleanEnv ( 'SCHEDULE' ) ,
143- cancelOutdatedPipelines : getBooleanEnv ( 'CANCEL_OUTDATED_PIPELINES' )
147+ cancelOutdatedPipelines : getBooleanEnv ( 'CANCEL_OUTDATED_PIPELINES' ) ,
148+ githubShaOverride : getOptionalEnv ( 'GITHUB_SHA_OVERRIDE' )
144149 } ;
145150
146151 const githubConfig = {
@@ -157,6 +162,10 @@ async function main () {
157162 break ;
158163 case 'push' :
159164 case 'schedule' :
165+ if ( inputConfig . githubShaOverride ) {
166+ githubConfig . githubSha = inputConfig . githubShaOverride ;
167+ }
168+ break ;
160169 case 'merge_group' :
161170 break ;
162171 default :
You can’t perform that action at this time.
0 commit comments