@@ -16,18 +16,18 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
16
16
17
17
const inputCwd = core . getInput ( "cwd" ) ;
18
18
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" ) ;
20
20
process . chdir ( inputCwd ) ;
21
21
}
22
22
23
23
let setupGitUser = core . getBooleanInput ( "setupGitUser" ) ;
24
24
25
25
if ( setupGitUser ) {
26
- console . log ( "setting git user" ) ;
26
+ core . info ( "setting git user" ) ;
27
27
await gitUtils . setupUser ( ) ;
28
28
}
29
29
30
- console . log ( "setting GitHub credentials" ) ;
30
+ core . info ( "setting GitHub credentials" ) ;
31
31
await fs . writeFile (
32
32
`${ process . env . HOME } /.netrc` ,
33
33
`machine github.com\nlogin github-actions[bot]\npassword ${ githubToken } `
@@ -48,27 +48,27 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
48
48
49
49
switch ( true ) {
50
50
case ! hasChangesets && ! hasPublishScript :
51
- console . log ( "No changesets found" ) ;
51
+ core . info ( "No changesets found" ) ;
52
52
return ;
53
53
case ! hasChangesets && hasPublishScript : {
54
- console . log (
54
+ core . info (
55
55
"No changesets found, attempting to publish any unpublished packages to npm"
56
56
) ;
57
57
58
58
let userNpmrcPath = `${ process . env . HOME } /.npmrc` ;
59
59
if ( fs . existsSync ( userNpmrcPath ) ) {
60
- console . log ( "Found existing user .npmrc file" ) ;
60
+ core . info ( "Found existing user .npmrc file" ) ;
61
61
const userNpmrcContent = await fs . readFile ( userNpmrcPath , "utf8" ) ;
62
62
const authLine = userNpmrcContent . split ( "\n" ) . find ( ( line ) => {
63
63
// check based on https://github.com/npm/cli/blob/8f8f71e4dd5ee66b3b17888faad5a7bf6c657eed/test/lib/adduser.js#L103-L105
64
64
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 ) ;
65
65
} ) ;
66
66
if ( authLine ) {
67
- console . log (
67
+ core . info (
68
68
"Found existing auth token for the npm registry in the user .npmrc file"
69
69
) ;
70
70
} else {
71
- console . log (
71
+ core . info (
72
72
"Didn't find existing auth token for the npm registry in the user .npmrc file, creating one"
73
73
) ;
74
74
fs . appendFileSync (
@@ -77,7 +77,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
77
77
) ;
78
78
}
79
79
} else {
80
- console . log ( "No user .npmrc file found, creating one" ) ;
80
+ core . info ( "No user .npmrc file found, creating one" ) ;
81
81
fs . writeFileSync (
82
82
userNpmrcPath ,
83
83
`//registry.npmjs.org/:_authToken=${ process . env . NPM_TOKEN } \n`
@@ -100,7 +100,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
100
100
return ;
101
101
}
102
102
case hasChangesets && ! hasNonEmptyChangesets :
103
- console . log ( "All changesets are empty; not creating PR" ) ;
103
+ core . info ( "All changesets are empty; not creating PR" ) ;
104
104
return ;
105
105
case hasChangesets :
106
106
const { pullRequestNumber } = await runVersion ( {
@@ -116,6 +116,6 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
116
116
return ;
117
117
}
118
118
} ) ( ) . catch ( ( err ) => {
119
- console . error ( err ) ;
119
+ core . error ( err ) ;
120
120
core . setFailed ( err . message ) ;
121
121
} ) ;
0 commit comments