Skip to content

Commit

Permalink
Merge pull request #11 from rwx-research/support-choosing-release-cha…
Browse files Browse the repository at this point in the history
…nnel
  • Loading branch information
doxavore authored Nov 21, 2022
2 parents bad0d01 + 12f9b96 commit a8acc90
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
8 changes: 7 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a8acc90

Please sign in to comment.