Skip to content

Commit 07eefac

Browse files
author
Kovacs Alex
committed
fix: pushToBranch property wasn't checked properly
1 parent 9d307e7 commit 07eefac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const { access } = require('fs').promises;
88
const { join } = require('path');
99

1010
// Inputs
11-
const pushToBranch = Boolean(core.getInput('pushToBranch'));
11+
const pushToBranch = core.getInput('pushToBranch');
1212
const branchName = core.getInput('branch');
1313
const githubToken = core.getInput('githubToken');
1414
const directory = process.env.GITHUB_WORKSPACE;
1515

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

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

3939
const octokit = github.getOctokit(githubToken);
4040

0 commit comments

Comments
 (0)