Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function run() {
let kubeconfig = await getKubeconfig();
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfig);
issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath);
console.log('KUBECONFIG environment variable is set');
}
async function run() {
let kubeconfig = getKubeconfig();
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfig);
issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath);
console.log('KUBECONFIG environment variable is set');
await setContext();
}
let config = {
"auths": {
[loginServer]: {
auth: authenticationToken
}
}
}
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
const dirPath = path.join(runnerTempDirectory, `docker_login_${Date.now()}`);
await io.mkdirP(dirPath);
const dockerConfigPath = path.join(dirPath, `config.json`);
core.debug(`Writing docker config contents to ${dockerConfigPath}`);
fs.writeFileSync(dockerConfigPath, JSON.stringify(config));
issueCommand('set-env', { name: 'DOCKER_CONFIG' }, dirPath);
console.log('DOCKER_CONFIG environment variable is set');
}
function run() {
core.warning('This action is moved to azure/containers-actions repository, update your workflows to use those actions instead.');
let pathToDockerConfig = process.env['DOCKER_CONFIG'];
if (pathToDockerConfig && ioUtil.exists(pathToDockerConfig)) {
io.rmRF(pathToDockerConfig); // Deleting the docker config directory
core.debug(`${pathToDockerConfig} has been successfully deleted`);
}
;
command_1.issueCommand('set-env', { name: 'DOCKER_CONFIG' }, '');
console.log('DOCKER_CONFIG environment variable unset');
}
run();
return __awaiter(this, void 0, void 0, function* () {
let kubeconfig = yield getKubeconfig();
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfig);
command_1.issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath);
console.log('KUBECONFIG environment variable is set');
});
}
function run() {
core.warning('This action is moved to azure/containers-actions repository, update your workflows to use those actions instead.');
let pathToDockerConfig = process.env['DOCKER_CONFIG'];
if (pathToDockerConfig && ioUtil.exists(pathToDockerConfig)) {
io.rmRF(pathToDockerConfig); // Deleting the docker config directory
core.debug(`${pathToDockerConfig} has been successfully deleted`);
};
issueCommand('set-env', { name: 'DOCKER_CONFIG' }, '');
console.log('DOCKER_CONFIG environment variable unset');
}
let loginServer = core.getInput('login-server', { required: true });
let authenticationToken = new Buffer(`${username}:${password}`).toString('base64');
let config = {
"auths": {
[loginServer]: {
auth: authenticationToken
}
}
};
const runnerTempDirectory = process.env['RUNNER_TEMP']; // Using process.env until the core libs are updated
const dirPath = path.join(runnerTempDirectory, `docker_login_${Date.now()}`);
yield io.mkdirP(dirPath);
const dockerConfigPath = path.join(dirPath, `config.json`);
core.debug(`Writing docker config contents to ${dockerConfigPath}`);
fs.writeFileSync(dockerConfigPath, JSON.stringify(config));
command_1.issueCommand('set-env', { name: 'DOCKER_CONFIG' }, dirPath);
console.log('DOCKER_CONFIG environment variable is set');
});
}
lines.split("\n").forEach(function(line, index, arr) {
command.issueCommand('error', undefined, line)
})
}