Don't make temporary directories symlinks
`toolcache.extractTar` currently falls over when `ACTIONS_TEMP` contains a symlink, and the runner no longer exists, so it's unlikely our customers would be running with temporary directories that contain symlinks.
This commit is contained in:
parent
30681e79db
commit
c2fd5d10f6
3 changed files with 3 additions and 11 deletions
6
lib/util.js
generated
6
lib/util.js
generated
|
|
@ -89,11 +89,7 @@ exports.getToolNames = getToolNames;
|
||||||
// Mostly intended for use within tests.
|
// Mostly intended for use within tests.
|
||||||
async function withTmpDir(body) {
|
async function withTmpDir(body) {
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
|
||||||
const realSubdir = path.join(tmpDir, "real");
|
const result = await body(tmpDir);
|
||||||
fs.mkdirSync(realSubdir);
|
|
||||||
const symlinkSubdir = path.join(tmpDir, "symlink");
|
|
||||||
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
|
||||||
const result = await body(symlinkSubdir);
|
|
||||||
await (0, del_1.default)(tmpDir, { force: true });
|
await (0, del_1.default)(tmpDir, { force: true });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -112,11 +112,7 @@ export async function withTmpDir<T>(
|
||||||
body: (tmpDir: string) => Promise<T>
|
body: (tmpDir: string) => Promise<T>
|
||||||
): Promise<T> {
|
): Promise<T> {
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
|
||||||
const realSubdir = path.join(tmpDir, "real");
|
const result = await body(tmpDir);
|
||||||
fs.mkdirSync(realSubdir);
|
|
||||||
const symlinkSubdir = path.join(tmpDir, "symlink");
|
|
||||||
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
|
||||||
const result = await body(symlinkSubdir);
|
|
||||||
await del(tmpDir, { force: true });
|
await del(tmpDir, { force: true });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue