From 9cce54d89dbd67fd6434f09c2f01d5e22866916c Mon Sep 17 00:00:00 2001 From: Quintin Willison Date: Mon, 26 Sep 2022 18:19:05 +0100 Subject: [PATCH] Tell actions core getInput() to enforce that required inputs are supplied. --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f01b5cc..ff78f0f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ if (typeof githubRef !== 'string') { process.exit(1); } -const githubToken = core.getInput('githubToken'); +const githubToken = core.getInput('githubToken', {required: true}); const octokit = getOctokit(githubToken); const githubEvent = JSON.parse(fs.readFileSync(githubEventPath, 'utf8')); @@ -54,7 +54,7 @@ const createRef = (githubRef: string) => { const ref = createRef(githubRef) const s3BucketName = 'sdk.ably.com'; -const sourcePath = path.resolve(core.getInput('sourcePath')); +const sourcePath = path.resolve(core.getInput('sourcePath', {required: true})); // Optional artifactName: // - The getInput() method calls trim() for us by default (trimWhitespace: true)