mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-05-31 22:06:16 -07:00
Add optional argument to action
This commit is contained in:
committed by
frostebite
parent
2321712bb4
commit
a12e3e829e
@@ -47,6 +47,10 @@ inputs:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Custom parameters to configure the build.'
|
||||
useHostNetwork:
|
||||
required: false
|
||||
default: false
|
||||
description: 'Initialises Docker using the host network. (Linux only)'
|
||||
versioning:
|
||||
required: false
|
||||
default: 'Semantic'
|
||||
|
||||
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
@@ -327,6 +327,7 @@ class BuildParameters {
|
||||
androidExportType: input_1.default.androidExportType,
|
||||
androidSymbolType: androidSymbolExportType,
|
||||
customParameters: input_1.default.customParameters,
|
||||
useHostNetwork: input_1.default.useHostNetwork,
|
||||
sshAgent: input_1.default.sshAgent,
|
||||
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
||||
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
||||
@@ -637,7 +638,7 @@ class Docker {
|
||||
return await (0, exec_1.exec)(runCommand, undefined, options);
|
||||
}
|
||||
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
||||
const { workspace, actionFolder, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||
const { workspace, actionFolder, useHostNetwork, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
||||
if (!(0, node_fs_1.existsSync)(githubHome))
|
||||
(0, node_fs_1.mkdirSync)(githubHome);
|
||||
@@ -670,6 +671,7 @@ class Docker {
|
||||
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
||||
: ''} \
|
||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||
${useHostNetwork ? '--net=host' : ''} \
|
||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||
${image} \
|
||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||
@@ -1382,6 +1384,10 @@ class Input {
|
||||
static get customParameters() {
|
||||
return Input.getInput('customParameters') ?? '';
|
||||
}
|
||||
static get useHostNetwork() {
|
||||
const input = Input.getInput('useHostNetwork') ?? false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get versioningStrategy() {
|
||||
return Input.getInput('versioning') ?? 'Semantic';
|
||||
}
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user