Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: correct reading of sync-labels input." #564

Merged
merged 1 commit into from May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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