File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,17 @@ describe('run', () => {
6262 const mockInput = {
6363 'repo-token' : 'foo' ,
6464 'configuration-path' : 'bar' ,
65- 'sync-labels' : true
65+ 'sync-labels' : ' true'
6666 } ;
6767
6868 jest
6969 . spyOn ( core , 'getInput' )
7070 . mockImplementation ( ( name : string , ...opts ) => mockInput [ name ] ) ;
71+ jest
72+ . spyOn ( core , 'getBooleanInput' )
73+ . mockImplementation (
74+ ( name : string , ...opts ) => mockInput [ name ] === 'true'
75+ ) ;
7176
7277 usingLabelerConfigYaml ( 'only_pdfs.yml' ) ;
7378 mockGitHubResponseChangedFiles ( 'foo.txt' ) ;
@@ -93,12 +98,17 @@ describe('run', () => {
9398 const mockInput = {
9499 'repo-token' : 'foo' ,
95100 'configuration-path' : 'bar' ,
96- 'sync-labels' : false
101+ 'sync-labels' : ' false'
97102 } ;
98103
99104 jest
100105 . spyOn ( core , 'getInput' )
101106 . mockImplementation ( ( name : string , ...opts ) => mockInput [ name ] ) ;
107+ jest
108+ . spyOn ( core , 'getBooleanInput' )
109+ . mockImplementation (
110+ ( name : string , ...opts ) => mockInput [ name ] === 'true'
111+ ) ;
102112
103113 usingLabelerConfigYaml ( 'only_pdfs.yml' ) ;
104114 mockGitHubResponseChangedFiles ( 'foo.txt' ) ;
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ function run() {
288288 try {
289289 const token = core.getInput('repo-token');
290290 const configPath = core.getInput('configuration-path', { required: true });
291- const syncLabels = !! core.getInput ('sync-labels', { required: false } );
291+ const syncLabels = core.getBooleanInput ('sync-labels');
292292 const prNumber = getPrNumber();
293293 if (!prNumber) {
294294 core.info('Could not get pull request number from context, exiting');
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export async function run() {
3131 try {
3232 const token = core . getInput ( 'repo-token' ) ;
3333 const configPath = core . getInput ( 'configuration-path' , { required : true } ) ;
34- const syncLabels = ! ! core . getInput ( 'sync-labels' , { required : false } ) ;
34+ const syncLabels = core . getBooleanInput ( 'sync-labels' ) ;
3535
3636 const prNumber = getPrNumber ( ) ;
3737 if ( ! prNumber ) {
You can’t perform that action at this time.
0 commit comments