change input name to reflect the type github private token
parent
5c8c30a3f2
commit
65ad600008
|
|
@ -110,13 +110,11 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: 'SSH Agent path to forward to the container'
|
description: 'SSH Agent path to forward to the container'
|
||||||
gitCredential:
|
gitPrivateToken:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: >
|
description: >
|
||||||
Git credential configuration
|
Github private token to pull from github
|
||||||
|
|
||||||
example: https://$token@github.com/
|
|
||||||
chownFilesTo:
|
chownFilesTo:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ class BuildParameters {
|
||||||
androidKeyaliasPass: input_1.default.androidKeyaliasPass,
|
androidKeyaliasPass: input_1.default.androidKeyaliasPass,
|
||||||
customParameters: input_1.default.customParameters,
|
customParameters: input_1.default.customParameters,
|
||||||
sshAgent: input_1.default.sshAgent,
|
sshAgent: input_1.default.sshAgent,
|
||||||
gitCredential: input_1.default.gitCredential,
|
gitPrivateToken: input_1.default.gitPrivateToken,
|
||||||
chownFilesTo: input_1.default.chownFilesTo,
|
chownFilesTo: input_1.default.chownFilesTo,
|
||||||
remoteBuildCluster: input_1.default.remoteBuildCluster,
|
remoteBuildCluster: input_1.default.remoteBuildCluster,
|
||||||
awsStackName: input_1.default.awsStackName,
|
awsStackName: input_1.default.awsStackName,
|
||||||
|
|
@ -348,7 +348,7 @@ class Docker {
|
||||||
}
|
}
|
||||||
static run(image, parameters, silent = false) {
|
static run(image, parameters, silent = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
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 \
|
const command = `docker run \
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
|
|
@ -389,7 +389,7 @@ class Docker {
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_CREDENTIAL="${gitCredential}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${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 "${runnerTempPath}/_github_home":"/root" \
|
--volume "${runnerTempPath}/_github_home":"/root" \
|
||||||
|
|
@ -671,8 +671,8 @@ class Input {
|
||||||
static get sshAgent() {
|
static get sshAgent() {
|
||||||
return core.getInput('sshAgent') || '';
|
return core.getInput('sshAgent') || '';
|
||||||
}
|
}
|
||||||
static get gitCredential() {
|
static get gitPrivateToken() {
|
||||||
return core.getInput('gitCredential') || '';
|
return core.getInput('gitPrivateToken') || '';
|
||||||
}
|
}
|
||||||
static get chownFilesTo() {
|
static get chownFilesTo() {
|
||||||
return core.getInput('chownFilesTo') || '';
|
return core.getInput('chownFilesTo') || '';
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,18 +1,18 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z "${GIT_CREDENTIAL}" ]
|
if [ -z "${GIT_PRIVATE_TOKEN}" ]
|
||||||
then
|
then
|
||||||
echo "GIT_CREDENTIAL unset skipping"
|
echo "GIT_PRIVATE_TOKEN unset skipping"
|
||||||
else
|
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 credential.helper store
|
||||||
git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/
|
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 --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://token:$GIT_PRIVATE_TOKEN@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://ssh:$GIT_PRIVATE_TOKEN@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://git:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com:"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
|
||||||
customParameters: '',
|
customParameters: '',
|
||||||
sshAgent: '',
|
sshAgent: '',
|
||||||
chownFilesTo: '',
|
chownFilesTo: '',
|
||||||
gitCredential: '',
|
gitPrivateToken: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class BuildParameters {
|
||||||
public androidKeyaliasPass!: string;
|
public androidKeyaliasPass!: string;
|
||||||
public customParameters!: string;
|
public customParameters!: string;
|
||||||
public sshAgent!: string;
|
public sshAgent!: string;
|
||||||
public gitCredential!: string;
|
public gitPrivateToken!: string;
|
||||||
public remoteBuildCluster!: string;
|
public remoteBuildCluster!: string;
|
||||||
public awsStackName!: string;
|
public awsStackName!: string;
|
||||||
public kubeConfig!: string;
|
public kubeConfig!: string;
|
||||||
|
|
@ -63,7 +63,7 @@ class BuildParameters {
|
||||||
androidKeyaliasPass: Input.androidKeyaliasPass,
|
androidKeyaliasPass: Input.androidKeyaliasPass,
|
||||||
customParameters: Input.customParameters,
|
customParameters: Input.customParameters,
|
||||||
sshAgent: Input.sshAgent,
|
sshAgent: Input.sshAgent,
|
||||||
gitCredential: Input.gitCredential,
|
gitPrivateToken: Input.gitPrivateToken,
|
||||||
chownFilesTo: Input.chownFilesTo,
|
chownFilesTo: Input.chownFilesTo,
|
||||||
remoteBuildCluster: Input.remoteBuildCluster,
|
remoteBuildCluster: Input.remoteBuildCluster,
|
||||||
awsStackName: Input.awsStackName,
|
awsStackName: Input.awsStackName,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Docker {
|
||||||
androidKeyaliasPass,
|
androidKeyaliasPass,
|
||||||
customParameters,
|
customParameters,
|
||||||
sshAgent,
|
sshAgent,
|
||||||
gitCredential,
|
gitPrivateToken,
|
||||||
chownFilesTo,
|
chownFilesTo,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
|
|
@ -81,7 +81,7 @@ class Docker {
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_CREDENTIAL="${gitCredential}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${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 "${runnerTempPath}/_github_home":"/root" \
|
--volume "${runnerTempPath}/_github_home":"/root" \
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ class Input {
|
||||||
return core.getInput('sshAgent') || '';
|
return core.getInput('sshAgent') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get gitCredential() {
|
static get gitPrivateToken() {
|
||||||
return core.getInput('gitCredential') || '';
|
return core.getInput('gitPrivateToken') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get chownFilesTo() {
|
static get chownFilesTo() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue