Skip to content

Commit

Permalink
Merge pull request #40 from ayeressian/37-39-fix-incorrect-warning-co…
Browse files Browse the repository at this point in the history
…ncurent-file-upload

Fix incorrect warning on upload flag and addition of concurrent uploader
  • Loading branch information
ayeressian authored Jul 19, 2023
2 parents 7881c20 + 0329744 commit 1ab6269
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "BunnyCDN storage deployer"
description: "BunnyCDN storage deployer"
inputs:
upload:
description: "It will upload the files to storage if 'true' provided."
default: "false"
source:
description: "The source directory folder."
required: true
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bunnycdn-storage-deploy",
"version": "2.0.2",
"version": "2.1.0",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import remove from "./remove";
const run = async () => {
try {
const sourceRaw = getInput("source");
const source = isAbsolute(sourceRaw) ? sourceRaw : join(
process.env.GITHUB_WORKSPACE as string,
sourceRaw
);
const source = isAbsolute(sourceRaw)
? sourceRaw
: join(process.env.GITHUB_WORKSPACE as string, sourceRaw);
const storageZoneName = getInput("storageZoneName");
const storageEndpoint =
getInput("storageEndpoint") ?? "storage.bunnycdn.com";
Expand Down
10 changes: 9 additions & 1 deletion src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ export default async function run(
storagePassword: string,
storageEndpoint: string
): Promise<void> {
const uploadFilePromises = [];
for await (const entry of readdirp(path)) {
await uploadFile(entry, storageName, storagePassword, storageEndpoint);
const uploadFilePromise = uploadFile(
entry,
storageName,
storagePassword,
storageEndpoint
);
uploadFilePromises.push(uploadFilePromise);
}
await Promise.all(uploadFilePromises);
}

0 comments on commit 1ab6269

Please sign in to comment.