Using SSH_AUTH_SOCK (ssh agent forwarding) to pull upm private repos (#124)
* using SSH_AUTH_SOCK (ssh agent forwarding) to pull upm private repos * sshAgent as input parameter * yarn run prettier --write "src/**/*.{js,ts}" * yarn run lint --fix && yarn build * reverted results-meta.ts (changed because ran prettier --check "src/**/*.js" without && eslint src) * removed RUN apt-get update && apt-get install -y openssh-client. This change needs to be done upstream. See game-ci/docker#117pull/127/head
parent
5eca106c01
commit
19661e2da7
|
@ -28,6 +28,10 @@ inputs:
|
||||||
customParameters:
|
customParameters:
|
||||||
required: false
|
required: false
|
||||||
description: 'Extra parameters to configure the Unity editor run.'
|
description: 'Extra parameters to configure the Unity editor run.'
|
||||||
|
sshAgent:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: 'SSH Agent path to forward to the container'
|
||||||
githubToken:
|
githubToken:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,6 +13,7 @@ async function action() {
|
||||||
artifactsPath,
|
artifactsPath,
|
||||||
useHostNetwork,
|
useHostNetwork,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
sshAgent,
|
||||||
githubToken,
|
githubToken,
|
||||||
checkName,
|
checkName,
|
||||||
} = Input.getFromUser();
|
} = Input.getFromUser();
|
||||||
|
@ -31,6 +32,7 @@ async function action() {
|
||||||
artifactsPath,
|
artifactsPath,
|
||||||
useHostNetwork,
|
useHostNetwork,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
sshAgent,
|
||||||
githubToken,
|
githubToken,
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -26,6 +26,7 @@ class Docker {
|
||||||
artifactsPath,
|
artifactsPath,
|
||||||
useHostNetwork,
|
useHostNetwork,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
sshAgent,
|
||||||
githubToken,
|
githubToken,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
|
@ -42,7 +43,6 @@ class Docker {
|
||||||
--env TEST_MODE="${testMode}" \
|
--env TEST_MODE="${testMode}" \
|
||||||
--env ARTIFACTS_PATH="${artifactsPath}" \
|
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
--env HOME=/github/home \
|
|
||||||
--env GITHUB_REF \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_REPOSITORY \
|
||||||
|
@ -58,10 +58,13 @@ class Docker {
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
||||||
--volume "/home/runner/work/_temp/_github_home":"/github/home" \
|
--volume "/home/runner/work/_temp/_github_home":"/root" \
|
||||||
--volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
|
--volume "/home/runner/work/_temp/_github_workflow":"/github/workflow" \
|
||||||
--volume "${workspace}":"/github/workspace" \
|
--volume "${workspace}":"/github/workspace" \
|
||||||
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
|
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
||||||
${useHostNetwork ? '--net=host' : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
${image}`;
|
${image}`;
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Input {
|
||||||
const rawArtifactsPath = getInput('artifactsPath') || 'artifacts';
|
const rawArtifactsPath = getInput('artifactsPath') || 'artifacts';
|
||||||
const rawUseHostNetwork = getInput('useHostNetwork') || 'false';
|
const rawUseHostNetwork = getInput('useHostNetwork') || 'false';
|
||||||
const customParameters = getInput('customParameters') || '';
|
const customParameters = getInput('customParameters') || '';
|
||||||
|
const sshAgent = getInput('sshAgent') || '';
|
||||||
const githubToken = getInput('githubToken') || '';
|
const githubToken = getInput('githubToken') || '';
|
||||||
const checkName = getInput('checkName') || 'Test Results';
|
const checkName = getInput('checkName') || 'Test Results';
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ class Input {
|
||||||
artifactsPath,
|
artifactsPath,
|
||||||
useHostNetwork,
|
useHostNetwork,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
sshAgent,
|
||||||
githubToken,
|
githubToken,
|
||||||
checkName,
|
checkName,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue