77
88import dataclasses
99import os
10+ from pathlib import Path
1011
1112from voluptuous import Any , Optional , Required
1213
2526 "powershell" : ["powershell.exe" , "-ExecutionPolicy" , "Bypass" ],
2627}
2728
29+ RUN_TASK_PATH = Path (__file__ ).parent .parent .parent / "run-task" / "run-task"
30+ FETCH_CONTENT_PATH = Path (__file__ ).parent .parent .parent / "run-task" / "fetch-content"
31+
2832run_task_schema = Schema (
2933 {
3034 Required ("using" ): "run-task" ,
@@ -169,10 +173,14 @@ def generic_worker_run_task(config, task, taskdesc):
169173 common_setup (config , task , taskdesc , command )
170174
171175 worker .setdefault ("mounts" , [])
176+ run_task_sha256 = hashlib .sha256 (RUN_TASK_PATH .read_bytes ()).hexdigest ()
177+ fetch_content_sha256 = hashlib .sha256 (FETCH_CONTENT_PATH .read_bytes ()).hexdigest ()
172178 worker ["mounts" ].append (
173179 {
174180 "content" : {
175- "url" : script_url (config , "run-task" ),
181+ "taskId" : {"task-reference" : "<decision>" },
182+ "artifact" : "public/run-task" ,
183+ "sha256" : run_task_sha256 ,
176184 },
177185 "file" : "./run-task" ,
178186 }
@@ -181,7 +189,9 @@ def generic_worker_run_task(config, task, taskdesc):
181189 worker ["mounts" ].append (
182190 {
183191 "content" : {
184- "url" : script_url (config , "fetch-content" ),
192+ "taskId" : {"task-reference" : "<decision>" },
193+ "artifact" : "public/fetch-content" ,
194+ "sha256" : fetch_content_sha256 ,
185195 },
186196 "file" : "./fetch-content" ,
187197 }
0 commit comments