Skip to content

Commit bd0718d

Browse files
matt-borisahal
authored andcommitted
feat: add run-task-as-current-user gw payload builder option
1 parent d9c772f commit bd0718d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/taskgraph/transforms/task.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ def build_docker_worker_payload(config, task, task_def):
649649
Optional("os-groups"): [str],
650650
# feature for test task to run as administarotr
651651
Optional("run-as-administrator"): bool,
652+
# feature for task to run as current OS user
653+
Optional("run-task-as-current-user"): bool,
652654
# optional features
653655
Required("chain-of-trust"): bool,
654656
Optional("taskcluster-proxy"): bool,
@@ -757,6 +759,12 @@ def build_generic_worker_payload(config, task, task_def):
757759
"generic-worker:run-as-administrator:{}".format(task["worker-type"]),
758760
)
759761

762+
if worker.get("run-task-as-current-user", False):
763+
features["runTaskAsCurrentUser"] = True
764+
task_def["scopes"].append(
765+
"generic-worker:run-task-as-current-user:{}".format(task["worker-type"]),
766+
)
767+
760768
if features:
761769
task_def["payload"]["features"] = features
762770

0 commit comments

Comments
 (0)