File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 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:
176176 raise AssertionError ()
177177
178178
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+
179194if __name__ == "__main__" :
180195 logging .basicConfig (level = logging .INFO )
181196
@@ -195,6 +210,7 @@ def format_run_type(run_type: WorkflowRunType) -> str:
195210 jobs = calculate_jobs (run_type , data )
196211 jobs = skip_jobs (jobs , channel )
197212
213+
198214 if not jobs :
199215 raise Exception ("Scheduled job list is empty, this is an error" )
200216
You can’t perform that action at this time.
0 commit comments