11require ( 'pretty-error' ) . start ( )
22
3- import core , { getInput , setFailed } from '@actions/core'
3+ import { endGroup , getInput , info , setFailed , startGroup } from '@actions/core'
44import githubLabelSync , { LabelInfo } from 'github-label-sync'
55import fs from 'fs'
66import path from 'path'
@@ -27,9 +27,9 @@ let usingLocalFile: boolean
2727 dryRun : getInput ( 'dry-run' ) == 'true'
2828 } )
2929
30- core . startGroup ( 'Label diff' )
31- core . info ( JSON . stringify ( diff , null , 2 ) )
32- core . endGroup ( )
30+ startGroup ( 'Label diff' )
31+ info ( JSON . stringify ( diff , null , 2 ) )
32+ endGroup ( )
3333 } catch ( e ) { setFailed ( e ) }
3434} ) ( )
3535
@@ -88,18 +88,18 @@ function readConfigFile(filePath: string) {
8888}
8989
9090async function fetchRepoLabels ( repo : string , token ?: string ) : Promise < LabelInfo [ ] > {
91- core . startGroup ( 'Getting repo labels...' )
91+ startGroup ( 'Getting repo labels...' )
9292
9393 const url = `https://api.github.com/repos/${ repo } /labels` ,
9494 headers = token ? { Authorization : `token ${ token } ` } : undefined
95- core . info ( `Using following URL: ${ url } ` )
95+ info ( `Using following URL: ${ url } ` )
9696
9797 const { data } = await axios . get ( url , { headers } )
9898 if ( ! data || ! ( data instanceof Array ) )
9999 throw 'Can\'t get label data from GitHub API'
100100
101- core . info ( `${ data . length } labels fetched.` )
102- core . endGroup ( )
101+ info ( `${ data . length } labels fetched.` )
102+ endGroup ( )
103103
104104 return data . map ( element => ( {
105105 name : element . name as string ,
@@ -125,7 +125,7 @@ function checkInputs() {
125125 if ( sourceRepo && sourceRepo . split ( '/' ) . length != 2 )
126126 setFailed ( 'Source repo should be in the owner/repo format, like EndBug/label-sync!' )
127127 if ( sourceRepo && ! getInput ( 'source-repo-token' ) )
128- core . info ( 'You\'re using a source repo without a token: if your repository is private the action won\'t be able to read the labels.' )
128+ info ( 'You\'re using a source repo without a token: if your repository is private the action won\'t be able to read the labels.' )
129129
130130 if ( ! [ 'true' , 'false' ] . includes ( getInput ( 'delete-other-labels' ) ) )
131131 setFailed ( 'The only values you can use for the `delete-other-labels` option are `true` and `false`' )
0 commit comments