change input name to reflect the type github private token

pull/278/head
Alexander Brandstedt 2021-07-13 15:14:33 +02:00
parent 5c8c30a3f2
commit 65ad600008
8 changed files with 21 additions and 23 deletions

View File

@ -110,13 +110,11 @@ inputs:
required: false
default: ''
description: 'SSH Agent path to forward to the container'
gitCredential:
gitPrivateToken:
required: false
default: ''
description: >
Git credential configuration
example: https://$token@github.com/
Github private token to pull from github
chownFilesTo:
required: false
default: ''

10
dist/index.js vendored
View File

@ -230,7 +230,7 @@ class BuildParameters {
androidKeyaliasPass: input_1.default.androidKeyaliasPass,
customParameters: input_1.default.customParameters,
sshAgent: input_1.default.sshAgent,
gitCredential: input_1.default.gitCredential,
gitPrivateToken: input_1.default.gitPrivateToken,
chownFilesTo: input_1.default.chownFilesTo,
remoteBuildCluster: input_1.default.remoteBuildCluster,
awsStackName: input_1.default.awsStackName,
@ -348,7 +348,7 @@ class Docker {
}
static run(image, parameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, sshAgent, gitCredential, chownFilesTo, } = parameters;
const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters;
const command = `docker run \
--workdir /github/workspace \
--rm \
@ -389,7 +389,7 @@ class Docker {
--env RUNNER_TOOL_CACHE \
--env RUNNER_TEMP \
--env RUNNER_WORKSPACE \
--env GIT_CREDENTIAL="${gitCredential}" \
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTempPath}/_github_home":"/root" \
@ -671,8 +671,8 @@ class Input {
static get sshAgent() {
return core.getInput('sshAgent') || '';
}
static get gitCredential() {
return core.getInput('gitCredential') || '';
static get gitPrivateToken() {
return core.getInput('gitPrivateToken') || '';
}
static get chownFilesTo() {
return core.getInput('chownFilesTo') || '';

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,18 @@
#!/usr/bin/env bash
if [ -z "${GIT_CREDENTIAL}" ]
if [ -z "${GIT_PRIVATE_TOKEN}" ]
then
echo "GIT_CREDENTIAL unset skipping"
echo "GIT_PRIVATE_TOKEN unset skipping"
else
echo "GIT_CREDENTIAL is set configuring git credentials"
echo "GIT_PRIVATE_TOKEN is set configuring git credentials"
git config --global credential.helper store
git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
git config --global --add url.https://github.com/.insteadOf git@github.com
git config --global url."https://token:$GIT_CREDENTIAL@github.com/".insteadOf "https://github.com/"
git config --global url."https://ssh:$GIT_CREDENTIAL@github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://git:$GIT_CREDENTIAL@github.com/".insteadOf "git@github.com:"
git config --global url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "https://github.com/"
git config --global url."https://ssh:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/"
git config --global url."https://git:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com:"
fi

View File

@ -12,7 +12,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
customParameters: '',
sshAgent: '',
chownFilesTo: '',
gitCredential: '',
gitPrivateToken: '',
});
export default {

View File

@ -23,7 +23,7 @@ class BuildParameters {
public androidKeyaliasPass!: string;
public customParameters!: string;
public sshAgent!: string;
public gitCredential!: string;
public gitPrivateToken!: string;
public remoteBuildCluster!: string;
public awsStackName!: string;
public kubeConfig!: string;
@ -63,7 +63,7 @@ class BuildParameters {
androidKeyaliasPass: Input.androidKeyaliasPass,
customParameters: Input.customParameters,
sshAgent: Input.sshAgent,
gitCredential: Input.gitCredential,
gitPrivateToken: Input.gitPrivateToken,
chownFilesTo: Input.chownFilesTo,
remoteBuildCluster: Input.remoteBuildCluster,
awsStackName: Input.awsStackName,

View File

@ -37,7 +37,7 @@ class Docker {
androidKeyaliasPass,
customParameters,
sshAgent,
gitCredential,
gitPrivateToken,
chownFilesTo,
} = parameters;
@ -81,7 +81,7 @@ class Docker {
--env RUNNER_TOOL_CACHE \
--env RUNNER_TEMP \
--env RUNNER_WORKSPACE \
--env GIT_CREDENTIAL="${gitCredential}" \
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTempPath}/_github_home":"/root" \

View File

@ -89,8 +89,8 @@ class Input {
return core.getInput('sshAgent') || '';
}
static get gitCredential() {
return core.getInput('gitCredential') || '';
static get gitPrivateToken() {
return core.getInput('gitPrivateToken') || '';
}
static get chownFilesTo() {