Skip to content

Commit

Permalink
Revert "fix: correct reading of sync-labels input. (#480)" (#564)
Browse files Browse the repository at this point in the history
This reverts commit 751921c.
  • Loading branch information
MaksimZhukov committed May 23, 2023
1 parent 61662e8 commit 5c4deb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
14 changes: 2 additions & 12 deletions __tests__/main.test.ts
Expand Up @@ -51,17 +51,12 @@ describe('run', () => {
const mockInput = {
'repo-token': 'foo',
'configuration-path': 'bar',
'sync-labels': 'true'
'sync-labels': true
};

jest
.spyOn(core, 'getInput')
.mockImplementation((name: string, ...opts) => mockInput[name]);
jest
.spyOn(core, 'getBooleanInput')
.mockImplementation(
(name: string, ...opts) => mockInput[name] === 'true'
);

usingLabelerConfigYaml('only_pdfs.yml');
mockGitHubResponseChangedFiles('foo.txt');
Expand All @@ -87,17 +82,12 @@ describe('run', () => {
const mockInput = {
'repo-token': 'foo',
'configuration-path': 'bar',
'sync-labels': 'false'
'sync-labels': false
};

jest
.spyOn(core, 'getInput')
.mockImplementation((name: string, ...opts) => mockInput[name]);
jest
.spyOn(core, 'getBooleanInput')
.mockImplementation(
(name: string, ...opts) => mockInput[name] === 'true'
);

usingLabelerConfigYaml('only_pdfs.yml');
mockGitHubResponseChangedFiles('foo.txt');
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Expand Up @@ -49,7 +49,7 @@ function run() {
try {
const token = core.getInput('repo-token');
const configPath = core.getInput('configuration-path', { required: true });
const syncLabels = core.getBooleanInput('sync-labels');
const syncLabels = !!core.getInput('sync-labels', { required: false });
const prNumber = getPrNumber();
if (!prNumber) {
core.info('Could not get pull request number from context, exiting');
Expand Down
2 changes: 1 addition & 1 deletion src/labeler.ts
Expand Up @@ -15,7 +15,7 @@ export async function run() {
try {
const token = core.getInput('repo-token');
const configPath = core.getInput('configuration-path', {required: true});
const syncLabels = core.getBooleanInput('sync-labels');
const syncLabels = !!core.getInput('sync-labels', {required: false});

const prNumber = getPrNumber();
if (!prNumber) {
Expand Down

0 comments on commit 5c4deb8

Please sign in to comment.