Skip to content

Commit

Permalink
Merge pull request #250 from crazy-max/bool-input
Browse files Browse the repository at this point in the history
use core.getBooleanInput
  • Loading branch information
crazy-max authored Jul 16, 2022
2 parents f2e698d + 2c65335 commit 9680028
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ inputs:
working_dir:
description: 'Working directory'
required: false
docker-repo:
deprecationMessage: 'docker-repo is deprecated and not used anymore.'
description: 'Use custom docker repo instead of official distribution'
default: 'ghcr.io/crazy-max/xgo'
required: false

runs:
using: 'node16'
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ async function run(): Promise<void> {
const pkg = core.getInput('pkg');
const prefix = core.getInput('prefix');
const targets = core.getInput('targets');
const v = core.getInput('v');
const x = core.getInput('x');
const race = core.getInput('race');
const v = core.getBooleanInput('v');
const x = core.getBooleanInput('x');
const race = core.getBooleanInput('race');
const tags = core.getInput('tags');
const ldflags = core.getInput('ldflags');
const buildmode = core.getInput('buildmode');
const buildvcs = core.getInput('buildvcs');
const trimpath = core.getInput('trimpath');
const trimpath = core.getBooleanInput('trimpath');
const workingDir = path.resolve(core.getInput('working_dir') || process.env['GITHUB_WORKSPACE'] || '.');

core.startGroup(`Download and install xgo`);
Expand All @@ -49,13 +49,13 @@ async function run(): Promise<void> {
if (targets) {
args.push('-targets', targets);
}
if (/true/i.test(v)) {
if (v) {
args.push('-v');
}
if (/true/i.test(x)) {
if (x) {
args.push('-x');
}
if (/true/i.test(race)) {
if (race) {
args.push('-race');
}
if (tags) {
Expand All @@ -70,7 +70,7 @@ async function run(): Promise<void> {
if (buildvcs) {
args.push('-buildvcs', buildvcs);
}
if (/true/i.test(trimpath)) {
if (trimpath) {
args.push('-trimpath');
}
args.push('.');
Expand Down

0 comments on commit 9680028

Please sign in to comment.