mirror of
https://github.com/actions/checkout.git
synced 2024-11-26 19:12:09 +00:00
.
This commit is contained in:
parent
a039094e93
commit
ba329ee889
2 changed files with 10 additions and 10 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -8373,7 +8373,7 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat
|
||||||
const archivePath = path.join(runnerTemp, 'checkout.tar.gz');
|
const archivePath = path.join(runnerTemp, 'checkout.tar.gz');
|
||||||
// await fs.promises.writeFile(archivePath, raw)
|
// await fs.promises.writeFile(archivePath, raw)
|
||||||
// Get the archive URL using the REST API
|
// Get the archive URL using the REST API
|
||||||
let archiveUrl = retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||||
// Prepare the archive stream
|
// Prepare the archive stream
|
||||||
core.debug(`Preparing the archive stream: ${archivePath}`);
|
core.debug(`Preparing the archive stream: ${archivePath}`);
|
||||||
yield io.rmRF(archivePath);
|
yield io.rmRF(archivePath);
|
||||||
|
@ -8464,16 +8464,16 @@ function downloadFile(url, fileStream) {
|
||||||
response.resume(); // Consume response data to free up memory
|
response.resume(); // Consume response data to free up memory
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// response.on('data', chunk => {
|
response.on('data', chunk => {
|
||||||
// fileStream.write(chunk)
|
fileStream.write(chunk);
|
||||||
// })
|
});
|
||||||
response.on('end', () => {
|
response.on('end', () => {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
response.on('error', err => {
|
response.on('error', err => {
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
response.pipe(fileStream);
|
// response.pipe(fileStream)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ export async function downloadRepository(
|
||||||
// await fs.promises.writeFile(archivePath, raw)
|
// await fs.promises.writeFile(archivePath, raw)
|
||||||
|
|
||||||
// Get the archive URL using the REST API
|
// Get the archive URL using the REST API
|
||||||
let archiveUrl = retryHelper.execute(async () => {
|
await retryHelper.execute(async () => {
|
||||||
// Prepare the archive stream
|
// Prepare the archive stream
|
||||||
core.debug(`Preparing the archive stream: ${archivePath}`)
|
core.debug(`Preparing the archive stream: ${archivePath}`)
|
||||||
await io.rmRF(archivePath)
|
await io.rmRF(archivePath)
|
||||||
|
@ -142,16 +142,16 @@ function downloadFile(url: string, fileStream: WriteStream): Promise<void> {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// response.on('data', chunk => {
|
response.on('data', chunk => {
|
||||||
// fileStream.write(chunk)
|
fileStream.write(chunk)
|
||||||
// })
|
})
|
||||||
response.on('end', () => {
|
response.on('end', () => {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
response.on('error', err => {
|
response.on('error', err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
response.pipe(fileStream)
|
// response.pipe(fileStream)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|
Loading…
Reference in a new issue