Skip to content

Commit

Permalink
fix: pushToBranch property wasn't checked properly
Browse files Browse the repository at this point in the history
  • Loading branch information
alexthemaster committed Jan 14, 2021
1 parent 9d307e7 commit 07eefac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const { access } = require('fs').promises;
const { join } = require('path');

// Inputs
const pushToBranch = Boolean(core.getInput('pushToBranch'));
const pushToBranch = core.getInput('pushToBranch');
const branchName = core.getInput('branch');
const githubToken = core.getInput('githubToken');
const directory = process.env.GITHUB_WORKSPACE;

if (pushToBranch && !githubToken) return exit('A GitHub secret token is a required input for pushing code (hint: use ${{ secrets.GITHUB_TOKEN }} )');
if (pushToBranch == true && !githubToken) return exit('A GitHub secret token is a required input for pushing code (hint: use ${{ secrets.GITHUB_TOKEN }} )');

(async () => {
const tsconfigPath = join(directory, 'tsconfig.json');
Expand All @@ -34,7 +34,7 @@ if (pushToBranch && !githubToken) return exit('A GitHub secret token is a requir
// Build project
const build = await exec(`tsc`, [], { cwd: directory });
if (build !== 0) return exit('Something went wrong while building.');
if (!pushToBranch) return process.exit(0);
if (pushToBranch == 'false') return process.exit(0);

const octokit = github.getOctokit(githubToken);

Expand Down

0 comments on commit 07eefac

Please sign in to comment.