mirror of https://github.com/actions/checkout.git
parent
dc519229d3
commit
1929737c8e
|
@ -498,6 +498,10 @@ class GitAuthHelper {
|
||||||
}
|
}
|
||||||
// Remove credentials config files
|
// Remove credentials config files
|
||||||
for (const credentialsPath of credentialsPaths) {
|
for (const credentialsPath of credentialsPaths) {
|
||||||
|
// Only remove credentials config files if they are under RUNNER_TEMP
|
||||||
|
const runnerTemp = process.env['RUNNER_TEMP'];
|
||||||
|
assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
|
||||||
|
if (credentialsPath.startsWith(runnerTemp)) {
|
||||||
try {
|
try {
|
||||||
core.info(`Removing credentials config '${credentialsPath}'`);
|
core.info(`Removing credentials config '${credentialsPath}'`);
|
||||||
yield io.rmRF(credentialsPath);
|
yield io.rmRF(credentialsPath);
|
||||||
|
@ -507,6 +511,10 @@ class GitAuthHelper {
|
||||||
core.warning(`Failed to remove credentials config '${credentialsPath}'`);
|
core.warning(`Failed to remove credentials config '${credentialsPath}'`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -473,6 +473,10 @@ class GitAuthHelper {
|
||||||
|
|
||||||
// Remove credentials config files
|
// Remove credentials config files
|
||||||
for (const credentialsPath of credentialsPaths) {
|
for (const credentialsPath of credentialsPaths) {
|
||||||
|
// Only remove credentials config files if they are under RUNNER_TEMP
|
||||||
|
const runnerTemp = process.env['RUNNER_TEMP']
|
||||||
|
assert.ok(runnerTemp, 'RUNNER_TEMP is not defined')
|
||||||
|
if (credentialsPath.startsWith(runnerTemp)) {
|
||||||
try {
|
try {
|
||||||
core.info(`Removing credentials config '${credentialsPath}'`)
|
core.info(`Removing credentials config '${credentialsPath}'`)
|
||||||
await io.rmRF(credentialsPath)
|
await io.rmRF(credentialsPath)
|
||||||
|
@ -482,6 +486,9 @@ class GitAuthHelper {
|
||||||
`Failed to remove credentials config '${credentialsPath}'`
|
`Failed to remove credentials config '${credentialsPath}'`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue