File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,21 @@ def format_run_type(run_type: WorkflowRunType) -> str:
176
176
raise AssertionError ()
177
177
178
178
179
+ # Add new function before main:
180
+ def substitute_github_vars (jobs : list ) -> list :
181
+ """Replace GitHub context variables with environment variables in job configs."""
182
+ for job in jobs :
183
+ if "os" in job :
184
+ job ["os" ] = job ["os" ].replace (
185
+ "${{ github.run_id }}" ,
186
+ os .environ ["GITHUB_RUN_ID" ]
187
+ ).replace (
188
+ "${{ github.run_attempt }}" ,
189
+ os .environ ["GITHUB_RUN_ATTEMPT" ]
190
+ )
191
+ return jobs
192
+
193
+
179
194
if __name__ == "__main__" :
180
195
logging .basicConfig (level = logging .INFO )
181
196
@@ -195,6 +210,7 @@ def format_run_type(run_type: WorkflowRunType) -> str:
195
210
jobs = calculate_jobs (run_type , data )
196
211
jobs = skip_jobs (jobs , channel )
197
212
213
+
198
214
if not jobs :
199
215
raise Exception ("Scheduled job list is empty, this is an error" )
200
216
You can’t perform that action at this time.
0 commit comments