mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 20:24:51 +00:00
fix: correct reading of sync-labels input
This commit is contained in:
@@ -62,12 +62,17 @@ describe('run', () => {
|
|||||||
const mockInput = {
|
const mockInput = {
|
||||||
'repo-token': 'foo',
|
'repo-token': 'foo',
|
||||||
'configuration-path': 'bar',
|
'configuration-path': 'bar',
|
||||||
'sync-labels': true
|
'sync-labels': 'true'
|
||||||
};
|
};
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(core, 'getInput')
|
.spyOn(core, 'getInput')
|
||||||
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
||||||
|
jest
|
||||||
|
.spyOn(core, 'getBooleanInput')
|
||||||
|
.mockImplementation(
|
||||||
|
(name: string, ...opts) => mockInput[name] === 'true'
|
||||||
|
);
|
||||||
|
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.txt');
|
mockGitHubResponseChangedFiles('foo.txt');
|
||||||
@@ -93,12 +98,17 @@ describe('run', () => {
|
|||||||
const mockInput = {
|
const mockInput = {
|
||||||
'repo-token': 'foo',
|
'repo-token': 'foo',
|
||||||
'configuration-path': 'bar',
|
'configuration-path': 'bar',
|
||||||
'sync-labels': false
|
'sync-labels': 'false'
|
||||||
};
|
};
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(core, 'getInput')
|
.spyOn(core, 'getInput')
|
||||||
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
||||||
|
jest
|
||||||
|
.spyOn(core, 'getBooleanInput')
|
||||||
|
.mockImplementation(
|
||||||
|
(name: string, ...opts) => mockInput[name] === 'true'
|
||||||
|
);
|
||||||
|
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.txt');
|
mockGitHubResponseChangedFiles('foo.txt');
|
||||||
|
|||||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -288,7 +288,7 @@ function run() {
|
|||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
const configPath = core.getInput('configuration-path', { required: true });
|
const configPath = core.getInput('configuration-path', { required: true });
|
||||||
const syncLabels = !!core.getInput('sync-labels', { required: false });
|
const syncLabels = core.getBooleanInput('sync-labels');
|
||||||
const prNumber = getPrNumber();
|
const prNumber = getPrNumber();
|
||||||
if (!prNumber) {
|
if (!prNumber) {
|
||||||
core.info('Could not get pull request number from context, exiting');
|
core.info('Could not get pull request number from context, exiting');
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export async function run() {
|
|||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
const configPath = core.getInput('configuration-path', {required: true});
|
const configPath = core.getInput('configuration-path', {required: true});
|
||||||
const syncLabels = !!core.getInput('sync-labels', {required: false});
|
const syncLabels = core.getBooleanInput('sync-labels');
|
||||||
|
|
||||||
const prNumber = getPrNumber();
|
const prNumber = getPrNumber();
|
||||||
if (!prNumber) {
|
if (!prNumber) {
|
||||||
|
|||||||
Reference in New Issue
Block a user