mirror of
https://gitea.com/actions/gitea-release-action.git
synced 2026-03-24 21:58:23 +00:00
fix: must still call thefileHandle.close() method since nodejs v17
This commit is contained in:
5
dist/index.js
vendored
5
dist/index.js
vendored
@@ -48271,7 +48271,8 @@ async function createStreamableFile(fpath) {
|
|||||||
const { size } = await handle.stat();
|
const { size } = await handle.stat();
|
||||||
|
|
||||||
const file = new external_buffer_.File([], name);
|
const file = new external_buffer_.File([], name);
|
||||||
file.stream = () => handle.readableWebStream({autoClose: true});
|
file.stream = () => handle.readableWebStream();
|
||||||
|
file.close = async () => await handle?.close();
|
||||||
|
|
||||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||||
Object.defineProperty(file, 'size', { get: () => size });
|
Object.defineProperty(file, 'size', { get: () => size });
|
||||||
@@ -48374,6 +48375,7 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
|
|||||||
attachment: curfile,
|
attachment: curfile,
|
||||||
name: external_path_.basename(filepath),
|
name: external_path_.basename(filepath),
|
||||||
})
|
})
|
||||||
|
await curfile.close();
|
||||||
let algorithms = [];
|
let algorithms = [];
|
||||||
if (params.md5sum) {
|
if (params.md5sum) {
|
||||||
algorithms = algorithms.concat('md5');
|
algorithms = algorithms.concat('md5');
|
||||||
@@ -48385,6 +48387,7 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
|
|||||||
if (algorithms.length !== 0) {
|
if (algorithms.length !== 0) {
|
||||||
curfile = await createStreamableFile(filepath)
|
curfile = await createStreamableFile(filepath)
|
||||||
hashes = await calculateMultipleHashes(curfile, algorithms)
|
hashes = await calculateMultipleHashes(curfile, algorithms)
|
||||||
|
await curfile.close();
|
||||||
}
|
}
|
||||||
if (params.md5sum) {
|
if (params.md5sum) {
|
||||||
let hash = hashes.md5;
|
let hash = hashes.md5;
|
||||||
|
|||||||
5
main.js
5
main.js
@@ -133,7 +133,8 @@ async function createStreamableFile(fpath) {
|
|||||||
const { size } = await handle.stat();
|
const { size } = await handle.stat();
|
||||||
|
|
||||||
const file = new File([], name);
|
const file = new File([], name);
|
||||||
file.stream = () => handle.readableWebStream({autoClose: true});
|
file.stream = () => handle.readableWebStream();
|
||||||
|
file.close = async () => await handle?.close();
|
||||||
|
|
||||||
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
// Set correct size otherwise, fetch will encounter UND_ERR_REQ_CONTENT_LENGTH_MISMATCH
|
||||||
Object.defineProperty(file, 'size', { get: () => size });
|
Object.defineProperty(file, 'size', { get: () => size });
|
||||||
@@ -236,6 +237,7 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
|
|||||||
attachment: curfile,
|
attachment: curfile,
|
||||||
name: path.basename(filepath),
|
name: path.basename(filepath),
|
||||||
})
|
})
|
||||||
|
await curfile.close();
|
||||||
let algorithms = [];
|
let algorithms = [];
|
||||||
if (params.md5sum) {
|
if (params.md5sum) {
|
||||||
algorithms = algorithms.concat('md5');
|
algorithms = algorithms.concat('md5');
|
||||||
@@ -247,6 +249,7 @@ async function uploadFiles(client, owner, repo, release_id, all_files, params) {
|
|||||||
if (algorithms.length !== 0) {
|
if (algorithms.length !== 0) {
|
||||||
curfile = await createStreamableFile(filepath)
|
curfile = await createStreamableFile(filepath)
|
||||||
hashes = await calculateMultipleHashes(curfile, algorithms)
|
hashes = await calculateMultipleHashes(curfile, algorithms)
|
||||||
|
await curfile.close();
|
||||||
}
|
}
|
||||||
if (params.md5sum) {
|
if (params.md5sum) {
|
||||||
let hash = hashes.md5;
|
let hash = hashes.md5;
|
||||||
|
|||||||
Reference in New Issue
Block a user