Skip to content

Commit

Permalink
Fix: boolean to string casting (#30)
Browse files Browse the repository at this point in the history
* Fix boolean values casting.

* Update package-lock.

* Build.

* Add lower case of input value.
  • Loading branch information
zamarawka authored Apr 16, 2021
1 parent 1c3df79 commit a815776
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,10 @@ exports.issueCommand = issueCommand;
const core = __webpack_require__(470);
const deploy = __webpack_require__(376);

function getBooleanInput(name) {
return core.getInput(name).toLowerCase() === 'true';
}

async function run() {
try {
const folder = core.getInput('folder');
Expand All @@ -1036,8 +1040,8 @@ async function run() {
const distId = core.getInput('dist-id');
const invalidation = core.getInput('invalidation') || '/';
const deleteRemoved = core.getInput('delete-removed') || false;
const noCache = core.getInput('no-cache') || false;
const private = core.getInput('private') || false;
const noCache = getBooleanInput('no-cache');
const private = getBooleanInput('private');

await deploy({ folder, bucket, bucketRegion, distId, invalidation, deleteRemoved, noCache, private });
} catch (error) {
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const core = require('@actions/core');
const deploy = require('./deploy');

function getBooleanInput(name) {
return core.getInput(name).toLowerCase() === 'true';
}

async function run() {
try {
const folder = core.getInput('folder');
Expand All @@ -9,8 +13,8 @@ async function run() {
const distId = core.getInput('dist-id');
const invalidation = core.getInput('invalidation') || '/';
const deleteRemoved = core.getInput('delete-removed') || false;
const noCache = core.getInput('no-cache') || false;
const private = core.getInput('private') || false;
const noCache = getBooleanInput('no-cache');
const private = getBooleanInput('private');

await deploy({ folder, bucket, bucketRegion, distId, invalidation, deleteRemoved, noCache, private });
} catch (error) {
Expand Down

0 comments on commit a815776

Please sign in to comment.