Skip to content

Commit

Permalink
Using SSH_AUTH_SOCK (ssh agent forwarding) to pull upm private repos (#…
Browse files Browse the repository at this point in the history
…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#117
  • Loading branch information
ivan-hernandez-scopely authored May 28, 2021
1 parent 5eca106 commit 19661e2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ inputs:
customParameters:
required: false
description: 'Extra parameters to configure the Unity editor run.'
sshAgent:
required: false
default: ''
description: 'SSH Agent path to forward to the container'
githubToken:
required: false
default: ''
Expand Down
2 changes: 1 addition & 1 deletion action/index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function action() {
artifactsPath,
useHostNetwork,
customParameters,
sshAgent,
githubToken,
checkName,
} = Input.getFromUser();
Expand All @@ -31,6 +32,7 @@ async function action() {
artifactsPath,
useHostNetwork,
customParameters,
sshAgent,
githubToken,
});
} finally {
Expand Down
7 changes: 5 additions & 2 deletions src/model/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Docker {
artifactsPath,
useHostNetwork,
customParameters,
sshAgent,
githubToken,
} = parameters;

Expand All @@ -42,7 +43,6 @@ class Docker {
--env TEST_MODE="${testMode}" \
--env ARTIFACTS_PATH="${artifactsPath}" \
--env CUSTOM_PARAMETERS="${customParameters}" \
--env HOME=/github/home \
--env GITHUB_REF \
--env GITHUB_SHA \
--env GITHUB_REPOSITORY \
Expand All @@ -58,10 +58,13 @@ class Docker {
--env RUNNER_TOOL_CACHE \
--env RUNNER_TEMP \
--env RUNNER_WORKSPACE \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--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 "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${useHostNetwork ? '--net=host' : ''} \
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
${image}`;
Expand Down
2 changes: 2 additions & 0 deletions src/model/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Input {
const rawArtifactsPath = getInput('artifactsPath') || 'artifacts';
const rawUseHostNetwork = getInput('useHostNetwork') || 'false';
const customParameters = getInput('customParameters') || '';
const sshAgent = getInput('sshAgent') || '';
const githubToken = getInput('githubToken') || '';
const checkName = getInput('checkName') || 'Test Results';

Expand Down Expand Up @@ -58,6 +59,7 @@ class Input {
artifactsPath,
useHostNetwork,
customParameters,
sshAgent,
githubToken,
checkName,
};
Expand Down

0 comments on commit 19661e2

Please sign in to comment.