@@ -16,18 +16,18 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
1616
1717 const inputCwd = core . getInput ( "cwd" ) ;
1818 if ( inputCwd ) {
19- console . log ( "changing directory to the one given as the input" ) ;
19+ core . info ( "changing directory to the one given as the input" ) ;
2020 process . chdir ( inputCwd ) ;
2121 }
2222
2323 let setupGitUser = core . getBooleanInput ( "setupGitUser" ) ;
2424
2525 if ( setupGitUser ) {
26- console . log ( "setting git user" ) ;
26+ core . info ( "setting git user" ) ;
2727 await gitUtils . setupUser ( ) ;
2828 }
2929
30- console . log ( "setting GitHub credentials" ) ;
30+ core . info ( "setting GitHub credentials" ) ;
3131 await fs . writeFile (
3232 `${ process . env . HOME } /.netrc` ,
3333 `machine github.com\nlogin github-actions[bot]\npassword ${ githubToken } `
@@ -48,27 +48,27 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
4848
4949 switch ( true ) {
5050 case ! hasChangesets && ! hasPublishScript :
51- console . log ( "No changesets found" ) ;
51+ core . info ( "No changesets found" ) ;
5252 return ;
5353 case ! hasChangesets && hasPublishScript : {
54- console . log (
54+ core . info (
5555 "No changesets found, attempting to publish any unpublished packages to npm"
5656 ) ;
5757
5858 let userNpmrcPath = `${ process . env . HOME } /.npmrc` ;
5959 if ( fs . existsSync ( userNpmrcPath ) ) {
60- console . log ( "Found existing user .npmrc file" ) ;
60+ core . info ( "Found existing user .npmrc file" ) ;
6161 const userNpmrcContent = await fs . readFile ( userNpmrcPath , "utf8" ) ;
6262 const authLine = userNpmrcContent . split ( "\n" ) . find ( ( line ) => {
6363 // check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
6464 return / ^ \s * \/ \/ r e g i s t r y \. n p m j s \. o r g \/ : [ _ - ] a u t h T o k e n = / i. test ( line ) ;
6565 } ) ;
6666 if ( authLine ) {
67- console . log (
67+ core . info (
6868 "Found existing auth token for the npm registry in the user .npmrc file"
6969 ) ;
7070 } else {
71- console . log (
71+ core . info (
7272 "Didn't find existing auth token for the npm registry in the user .npmrc file, creating one"
7373 ) ;
7474 fs . appendFileSync (
@@ -77,7 +77,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
7777 ) ;
7878 }
7979 } else {
80- console . log ( "No user .npmrc file found, creating one" ) ;
80+ core . info ( "No user .npmrc file found, creating one" ) ;
8181 fs . writeFileSync (
8282 userNpmrcPath ,
8383 `//registry.npmjs.org/:_authToken=${ process . env . NPM_TOKEN } \n`
@@ -100,7 +100,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
100100 return ;
101101 }
102102 case hasChangesets && ! hasNonEmptyChangesets :
103- console . log ( "All changesets are empty; not creating PR" ) ;
103+ core . info ( "All changesets are empty; not creating PR" ) ;
104104 return ;
105105 case hasChangesets :
106106 const { pullRequestNumber } = await runVersion ( {
@@ -116,6 +116,6 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
116116 return ;
117117 }
118118} ) ( ) . catch ( ( err ) => {
119- console . error ( err ) ;
119+ core . error ( err ) ;
120120 core . setFailed ( err . message ) ;
121121} ) ;
0 commit comments