add chownFilesTo
parent
e8774f3837
commit
3cb1997ca9
|
|
@ -48,6 +48,10 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: 'Test Results'
|
default: 'Test Results'
|
||||||
description: 'Name for the check run that is created when a github token is provided.'
|
description: 'Name for the check run that is created when a github token is provided.'
|
||||||
|
chownFilesTo:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: 'User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build artifacts'
|
||||||
outputs:
|
outputs:
|
||||||
artifactsPath:
|
artifactsPath:
|
||||||
description: 'Path where the artifacts are stored.'
|
description: 'Path where the artifacts are stored.'
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ const Docker = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getLinuxCommand(image, parameters) {
|
getLinuxCommand(image, parameters) {
|
||||||
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
|
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, chownFilesTo, } = parameters;
|
||||||
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
||||||
if (!(0, fs_1.existsSync)(githubHome))
|
if (!(0, fs_1.existsSync)(githubHome))
|
||||||
(0, fs_1.mkdirSync)(githubHome);
|
(0, fs_1.mkdirSync)(githubHome);
|
||||||
|
|
@ -208,6 +208,7 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}:/root:z" \
|
--volume "${githubHome}:/root:z" \
|
||||||
--volume "${githubWorkflow}:/github/workflow:z" \
|
--volume "${githubWorkflow}:/github/workflow:z" \
|
||||||
|
|
@ -222,7 +223,7 @@ const Docker = {
|
||||||
/bin/bash -c /entrypoint.sh`;
|
/bin/bash -c /entrypoint.sh`;
|
||||||
},
|
},
|
||||||
getWindowsCommand(image, parameters) {
|
getWindowsCommand(image, parameters) {
|
||||||
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
|
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, chownFilesTo, } = parameters;
|
||||||
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
||||||
if (!(0, fs_1.existsSync)(githubHome))
|
if (!(0, fs_1.existsSync)(githubHome))
|
||||||
(0, fs_1.mkdirSync)(githubHome);
|
(0, fs_1.mkdirSync)(githubHome);
|
||||||
|
|
@ -261,6 +262,7 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}":"c:/root" \
|
--volume "${githubHome}":"c:/root" \
|
||||||
--volume "${githubWorkflow}":"c:/github/workflow" \
|
--volume "${githubWorkflow}":"c:/github/workflow" \
|
||||||
|
|
@ -477,6 +479,7 @@ const Input = {
|
||||||
const gitPrivateToken = (0, core_1.getInput)('gitPrivateToken') || '';
|
const gitPrivateToken = (0, core_1.getInput)('gitPrivateToken') || '';
|
||||||
const githubToken = (0, core_1.getInput)('githubToken') || '';
|
const githubToken = (0, core_1.getInput)('githubToken') || '';
|
||||||
const checkName = (0, core_1.getInput)('checkName') || 'Test Results';
|
const checkName = (0, core_1.getInput)('checkName') || 'Test Results';
|
||||||
|
const chownFilesTo = (0, core_1.getInput)('chownFilesTo') || '';
|
||||||
// Validate input
|
// Validate input
|
||||||
if (!this.testModes.includes(testMode)) {
|
if (!this.testModes.includes(testMode)) {
|
||||||
throw new Error(`Invalid testMode ${testMode}`);
|
throw new Error(`Invalid testMode ${testMode}`);
|
||||||
|
|
@ -509,6 +512,7 @@ const Input = {
|
||||||
gitPrivateToken,
|
gitPrivateToken,
|
||||||
githubToken,
|
githubToken,
|
||||||
checkName,
|
checkName,
|
||||||
|
chownFilesTo,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -114,3 +114,19 @@ for platform in ${TEST_PLATFORMS//;/ }; do
|
||||||
cat "$FULL_ARTIFACTS_PATH/$platform-results.xml" | grep test-run | grep Passed
|
cat "$FULL_ARTIFACTS_PATH/$platform-results.xml" | grep test-run | grep Passed
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# Permissions
|
||||||
|
#
|
||||||
|
|
||||||
|
# Make a given user owner of all artifacts
|
||||||
|
if [[ -n "$CHOWN_FILES_TO" ]]; then
|
||||||
|
chown -R "$CHOWN_FILES_TO" "$UNITY_PROJECT_PATH"
|
||||||
|
chown -R "$CHOWN_FILES_TO" "$FULL_ARTIFACTS_PATH"
|
||||||
|
chown -R "$CHOWN_FILES_TO" "$FULL_COVERAGE_RESULTS_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add read permissions for everyone to all artifacts
|
||||||
|
chmod -R a+r "$UNITY_PROJECT_PATH"
|
||||||
|
chmod -R a+r "$FULL_ARTIFACTS_PATH"
|
||||||
|
chmod -R a+r "$FULL_COVERAGE_RESULTS_PATH"
|
||||||
|
|
@ -33,6 +33,7 @@ const Docker = {
|
||||||
gitPrivateToken,
|
gitPrivateToken,
|
||||||
githubToken,
|
githubToken,
|
||||||
runnerTemporaryPath,
|
runnerTemporaryPath,
|
||||||
|
chownFilesTo,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||||
|
|
@ -74,6 +75,7 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}:/root:z" \
|
--volume "${githubHome}:/root:z" \
|
||||||
--volume "${githubWorkflow}:/github/workflow:z" \
|
--volume "${githubWorkflow}:/github/workflow:z" \
|
||||||
|
|
@ -105,6 +107,7 @@ const Docker = {
|
||||||
gitPrivateToken,
|
gitPrivateToken,
|
||||||
githubToken,
|
githubToken,
|
||||||
runnerTemporaryPath,
|
runnerTemporaryPath,
|
||||||
|
chownFilesTo,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||||
|
|
@ -146,6 +149,7 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}":"c:/root" \
|
--volume "${githubHome}":"c:/root" \
|
||||||
--volume "${githubWorkflow}":"c:/github/workflow" \
|
--volume "${githubWorkflow}":"c:/github/workflow" \
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ const Input = {
|
||||||
const gitPrivateToken = getInput('gitPrivateToken') || '';
|
const gitPrivateToken = getInput('gitPrivateToken') || '';
|
||||||
const githubToken = getInput('githubToken') || '';
|
const githubToken = getInput('githubToken') || '';
|
||||||
const checkName = getInput('checkName') || 'Test Results';
|
const checkName = getInput('checkName') || 'Test Results';
|
||||||
|
const chownFilesTo = getInput('chownFilesTo') || '';
|
||||||
|
|
||||||
// Validate input
|
// Validate input
|
||||||
if (!this.testModes.includes(testMode)) {
|
if (!this.testModes.includes(testMode)) {
|
||||||
|
|
@ -65,6 +66,7 @@ const Input = {
|
||||||
gitPrivateToken,
|
gitPrivateToken,
|
||||||
githubToken,
|
githubToken,
|
||||||
checkName,
|
checkName,
|
||||||
|
chownFilesTo,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue