kap-r2 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27,18 +27,23 @@ const isValidBucketName = (name) => {
|
|
|
27
27
|
return /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(name);
|
|
28
28
|
};
|
|
29
29
|
const action = async (context) => {
|
|
30
|
+
await log(`--- Action started ---`);
|
|
30
31
|
const accountId = context.config.get("accountId");
|
|
31
32
|
const accessKeyId = context.config.get("accessKeyId");
|
|
32
33
|
const secretAccessKey = context.config.get("secretAccessKey");
|
|
33
34
|
const bucket = context.config.get("bucket");
|
|
34
35
|
const directory = context.config.get("directory") || "";
|
|
35
36
|
const publicUrl = context.config.get("publicUrl");
|
|
37
|
+
await log(`AccountId: ${accountId}, Bucket: ${bucket}, PublicUrl: ${publicUrl}`);
|
|
38
|
+
await log(`AccountId valid: ${isValidAccountId(accountId)}, Bucket valid: ${isValidBucketName(bucket)}`);
|
|
36
39
|
if (!isValidAccountId(accountId)) {
|
|
40
|
+
await log(`FAIL: Invalid account ID`);
|
|
37
41
|
context.notify("Invalid Account ID. It should be a 32-character hex string.");
|
|
38
42
|
context.cancel();
|
|
39
43
|
return;
|
|
40
44
|
}
|
|
41
45
|
if (!isValidBucketName(bucket)) {
|
|
46
|
+
await log(`FAIL: Invalid bucket name`);
|
|
42
47
|
context.notify("Invalid Bucket Name. Use lowercase letters, numbers, and hyphens.");
|
|
43
48
|
context.cancel();
|
|
44
49
|
return;
|