Skip to content

Commit 5c4deb8

Browse files
authored
Revert "fix: correct reading of sync-labels input. (#480)" (#564)
This reverts commit 751921c.
1 parent 61662e8 commit 5c4deb8

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

__tests__/main.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,12 @@ describe('run', () => {
5151
const mockInput = {
5252
'repo-token': 'foo',
5353
'configuration-path': 'bar',
54-
'sync-labels': 'true'
54+
'sync-labels': true
5555
};
5656

5757
jest
5858
.spyOn(core, 'getInput')
5959
.mockImplementation((name: string, ...opts) => mockInput[name]);
60-
jest
61-
.spyOn(core, 'getBooleanInput')
62-
.mockImplementation(
63-
(name: string, ...opts) => mockInput[name] === 'true'
64-
);
6560

6661
usingLabelerConfigYaml('only_pdfs.yml');
6762
mockGitHubResponseChangedFiles('foo.txt');
@@ -87,17 +82,12 @@ describe('run', () => {
8782
const mockInput = {
8883
'repo-token': 'foo',
8984
'configuration-path': 'bar',
90-
'sync-labels': 'false'
85+
'sync-labels': false
9186
};
9287

9388
jest
9489
.spyOn(core, 'getInput')
9590
.mockImplementation((name: string, ...opts) => mockInput[name]);
96-
jest
97-
.spyOn(core, 'getBooleanInput')
98-
.mockImplementation(
99-
(name: string, ...opts) => mockInput[name] === 'true'
100-
);
10191

10292
usingLabelerConfigYaml('only_pdfs.yml');
10393
mockGitHubResponseChangedFiles('foo.txt');

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function run() {
4949
try {
5050
const token = core.getInput('repo-token');
5151
const configPath = core.getInput('configuration-path', { required: true });
52-
const syncLabels = core.getBooleanInput('sync-labels');
52+
const syncLabels = !!core.getInput('sync-labels', { required: false });
5353
const prNumber = getPrNumber();
5454
if (!prNumber) {
5555
core.info('Could not get pull request number from context, exiting');

src/labeler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function run() {
1515
try {
1616
const token = core.getInput('repo-token');
1717
const configPath = core.getInput('configuration-path', {required: true});
18-
const syncLabels = core.getBooleanInput('sync-labels');
18+
const syncLabels = !!core.getInput('sync-labels', {required: false});
1919

2020
const prNumber = getPrNumber();
2121
if (!prNumber) {

0 commit comments

Comments
 (0)