feat: add runAsHostUserReuseExisting input (#870)

Forwards a new opt-in input to game-ci/cli's --runAsHostUserReuseExisting
(game-ci/cli#330). With runAsHostUser, it reuses a group/user the image
already has at the host GID/UID instead of failing to create it - e.g. the
ubuntu user/group at 1000 in Ubuntu 24.04 based unityci/editor v4 images.

The flag is only passed when the input is true, so existing workflows
send the CLI exactly the same arguments.

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Andy Shinn
2026-11-27 21:32:49 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 107e018f9d
commit 188fd69ab7
5 changed files with 22 additions and 9 deletions
+7
View File
@@ -139,6 +139,13 @@ inputs:
description:
'Whether to run as a user that matches the host system or the default root container user. Only applicable to
Linux hosts and containers. This is useful for fixing permission errors on Self-Hosted runners.'
runAsHostUserReuseExisting:
required: false
default: 'false'
description:
"With runAsHostUser, reuse a group or user the image already has at the host GID/UID instead of failing to
create it - e.g. the ubuntu user/group at 1000 in Ubuntu 24.04 based images (unityci/editor v4), which is the
usual UID/GID of a self-hosted runner's account. Requires a game-ci/cli release that supports it."
chownFilesTo:
required: false
default: ''
Generated Vendored
+5 -4
View File
@@ -67,6 +67,7 @@ const BOOLEAN_FLAGS = [
['enableGpu', 'enableGpu'],
['useHostNetwork', 'useHostNetwork'],
['runAsHostUser', 'runAsHostUser'],
['runAsHostUserReuseExisting', 'runAsHostUserReuseExisting'],
['allowDirtyBuild', 'allowDirtyBuild'],
['cacheUnityInstallationOnMac', 'cacheUnityInstallationOnMac'],
['skipActivation', 'skipActivation'],
@@ -148,10 +149,10 @@ const ORCHESTRATE_BOOLEAN_FLAGS = [
// enableGpu: not assigned anywhere in build-parameters-adapter.ts or the
// orchestrator model - a real, currently-unfilled gap versus `build`'s
// GPU passthrough, not something to silently pretend to support.
// useHostNetwork/runAsHostUser: Docker networking/uid-mapping concepts;
// not assigned by the adapter, and runAsHostUser is meaningless by
// construction on a bare host process that already runs as that host
// user.
// useHostNetwork/runAsHostUser/runAsHostUserReuseExisting: Docker
// networking/uid-mapping concepts; not assigned by the adapter, and
// runAsHostUser is meaningless by construction on a bare host process
// that already runs as that host user.
// cacheUnityInstallationOnMac: build-parameters-adapter.ts DOES assign
// bp.cacheUnityInstallationOnMac, but nothing downstream (no provider,
// no workflow) ever reads it back - it's a currently-dead field for
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+4
View File
@@ -167,6 +167,7 @@ describe('buildCliArgs', () => {
enableGpu: 'true',
useHostNetwork: 'true',
runAsHostUser: 'true',
runAsHostUserReuseExisting: 'true',
allowDirtyBuild: 'true',
cacheUnityInstallationOnMac: 'true',
skipActivation: 'true',
@@ -210,6 +211,7 @@ describe('buildCliArgs', () => {
'--enableGpu',
'--useHostNetwork',
'--runAsHostUser',
'--runAsHostUserReuseExisting',
'--allowDirtyBuild',
'--cacheUnityInstallationOnMac',
'--skipActivation',
@@ -333,6 +335,7 @@ describe('buildCliArgs', () => {
enableGpu: 'true',
useHostNetwork: 'true',
runAsHostUser: 'true',
runAsHostUserReuseExisting: 'true',
cacheUnityInstallationOnMac: 'true',
linux64RemoveExecutableExtension: 'true',
};
@@ -364,6 +367,7 @@ describe('buildCliArgs', () => {
'enableGpu',
'useHostNetwork',
'runAsHostUser',
'runAsHostUserReuseExisting',
'cacheUnityInstallationOnMac',
'linux64RemoveExecutableExtension',
];
+5 -4
View File
@@ -59,6 +59,7 @@ const BOOLEAN_FLAGS: Array<[input: string, flag: string]> = [
['enableGpu', 'enableGpu'],
['useHostNetwork', 'useHostNetwork'],
['runAsHostUser', 'runAsHostUser'],
['runAsHostUserReuseExisting', 'runAsHostUserReuseExisting'],
['allowDirtyBuild', 'allowDirtyBuild'],
['cacheUnityInstallationOnMac', 'cacheUnityInstallationOnMac'],
['skipActivation', 'skipActivation'],
@@ -144,10 +145,10 @@ const ORCHESTRATE_BOOLEAN_FLAGS: Array<[input: string, flag: string]> = [
// enableGpu: not assigned anywhere in build-parameters-adapter.ts or the
// orchestrator model - a real, currently-unfilled gap versus `build`'s
// GPU passthrough, not something to silently pretend to support.
// useHostNetwork/runAsHostUser: Docker networking/uid-mapping concepts;
// not assigned by the adapter, and runAsHostUser is meaningless by
// construction on a bare host process that already runs as that host
// user.
// useHostNetwork/runAsHostUser/runAsHostUserReuseExisting: Docker
// networking/uid-mapping concepts; not assigned by the adapter, and
// runAsHostUser is meaningless by construction on a bare host process
// that already runs as that host user.
// cacheUnityInstallationOnMac: build-parameters-adapter.ts DOES assign
// bp.cacheUnityInstallationOnMac, but nothing downstream (no provider,
// no workflow) ever reads it back - it's a currently-dead field for