Skip to content

Commit

Permalink
feat: making the build script optional (#5)
Browse files Browse the repository at this point in the history
* feat: making the build script optional

* feat: flipping the required field to false
  • Loading branch information
JakePartusch authored and jackyef committed Jan 14, 2020
1 parent fcd9b72 commit 2c01713
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: 'Run bundlewatch against your PR to keep those bundles in check! Up
author: 'Jacky Efendi'
inputs:
build-script:
description: 'The build script for your project. Will be run before running bundlewatch'
required: true
description: 'Optional — The build script for your project. Will be run before running bundlewatch'
required: false

runs:
using: 'node12'
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ async function run() {
core.exportVariable('CI_BRANCH', branchName);
core.exportVariable('BUNDLEWATCH_GITHUB_TOKEN', bundlesizeGithubToken);

console.log(`Running build script: "${buildScript}"`);
await exec.exec(`${buildScript}`, undefined);
if(buildScript) {
console.log(`Running build script: "${buildScript}"`);
await exec.exec(`${buildScript}`, undefined);
}

console.log(`Running: bundlewatch`);
await exec.exec(`npx bundlewatch`, undefined);
Expand Down

0 comments on commit 2c01713

Please sign in to comment.