diff --git a/dist/index.js b/dist/index.js index ec96ee3..c2bedec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6604,7 +6604,13 @@ function getRunId() { function run() { return __awaiter(this, void 0, void 0, function* () { const accessToken = core.getInput('access-token'); - const releaseChannel = 'v1'; + if (!accessToken || accessToken.trim().length === 0) { + core.setFailed("`access-token` field can't be empty."); + } + const releaseChannel = core.getInput('release-channel') || 'v1'; + if (!['v1', 'latest'].includes(releaseChannel)) { + core.setFailed(`Invalid \`release-channel\` field: ${releaseChannel}. \`release-channel\` must be "v1" or "latest" (default is "v1").`); + } const os = getOs(); const arch = getArch(); const runId = getRunId(); diff --git a/package-lock.json b/package-lock.json index a8bc692..1a4f70c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "setup-abq", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "setup-abq", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "dependencies": { "@actions/core": "1.10.0", diff --git a/package.json b/package.json index 6739152..057908c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-abq", - "version": "1.0.1", + "version": "1.0.2", "private": true, "description": "This action installs the abq binary.", "main": "dist/index.js", diff --git a/src/index.ts b/src/index.ts index 5e765f9..5d63d79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,7 +29,16 @@ function getRunId() { async function run() { const accessToken = core.getInput('access-token') - const releaseChannel = 'v1' + if (!accessToken || accessToken.trim().length === 0) { + core.setFailed("`access-token` field can't be empty.") + } + + const releaseChannel = core.getInput('release-channel') || 'v1' + if (!['v1', 'latest'].includes(releaseChannel)) { + core.setFailed( + `Invalid \`release-channel\` field: ${releaseChannel}. \`release-channel\` must be "v1" or "latest" (default is "v1").` + ) + } const os = getOs() const arch = getArch() const runId = getRunId()