Read booleans from input using getBooleanInput (#627)

This commit is contained in:
Robin Raju authored and GitHub committed 2023-04-27 13:01:22 +01:00
1 parent 971a7f2843
commit 82329140db
3 files changed
+9 -8

No files matched your search

+1
View File
@@ -60,6 +60,7 @@ jobs:
fileName: "*"
tarBall: true
zipBall: true
extract: true
token: ${{ secrets.RELEASE_DOWNLOADER_TEST_TOKEN }}
out-file-path: "./downloader-test"
Generated Vendored
+4 -4
View File
@@ -46,7 +46,7 @@ function getInputs() {
throw new Error(`Invalid repository '${repositoryPath}'. Expected format {owner}/{repo}.`);
}
downloadSettings.sourceRepoPath = repositoryPath;
const latestFlag = core.getInput("latest") === "true";
const latestFlag = core.getBooleanInput("latest");
const ghTag = core.getInput("tag");
const releaseId = core.getInput("releaseId");
if ((latestFlag && ghTag.length > 0 && releaseId.length > 0) ||
@@ -57,9 +57,9 @@ function getInputs() {
downloadSettings.tag = ghTag;
downloadSettings.id = releaseId;
downloadSettings.fileName = core.getInput("fileName");
downloadSettings.tarBall = core.getInput("tarBall") === "true";
downloadSettings.zipBall = core.getInput("zipBall") === "true";
downloadSettings.extractAssets = core.getInput("extract") === "true";
downloadSettings.tarBall = core.getBooleanInput("tarBall");
downloadSettings.zipBall = core.getBooleanInput("zipBall");
downloadSettings.extractAssets = core.getBooleanInput("extract");
const outFilePath = core.getInput("out-file-path") || ".";
downloadSettings.outFilePath = path.resolve(githubWorkspacePath, outFilePath);
return downloadSettings;
+4 -4
View File
@@ -21,7 +21,7 @@ export function getInputs(): IReleaseDownloadSettings {
}
downloadSettings.sourceRepoPath = repositoryPath
const latestFlag = core.getInput("latest") === "true"
const latestFlag = core.getBooleanInput("latest")
const ghTag = core.getInput("tag")
const releaseId = core.getInput("releaseId")
@@ -42,11 +42,11 @@ export function getInputs(): IReleaseDownloadSettings {
downloadSettings.fileName = core.getInput("fileName")
downloadSettings.tarBall = core.getInput("tarBall") === "true"
downloadSettings.tarBall = core.getBooleanInput("tarBall")
downloadSettings.zipBall = core.getInput("zipBall") === "true"
downloadSettings.zipBall = core.getBooleanInput("zipBall")
downloadSettings.extractAssets = core.getInput("extract") === "true"
downloadSettings.extractAssets = core.getBooleanInput("extract")
const outFilePath = core.getInput("out-file-path") || "."
downloadSettings.outFilePath = path.resolve(githubWorkspacePath, outFilePath)