File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ try {
11
11
12
12
function checkInputs ( ) {
13
13
const eventPath = process . env . GITHUB_EVENT_PATH
14
- if ( eventPath ) {
15
- const { author } = require ( eventPath ) . head_commit
14
+ const author = eventPath && require ( eventPath ) ?. head_commit ?. author
15
+
16
+ if ( author ) {
16
17
setDefault ( 'author_name' , author . name )
17
18
setDefault ( 'author_email' , author . email )
18
19
} else {
19
- warning ( 'No event path available, unable to fetch author info.' )
20
+ warning ( `Unable to fetch author info: couldn't find ${ ! eventPath ? ' event path' : ! require ( eventPath ) ?. head_commit ? 'commit' : 'commit author' } .` )
20
21
setDefault ( 'author_name' , 'Add & Commit Action' )
21
22
setDefault ( 'author_email' , '[email protected] ' )
22
23
}
24
+
23
25
info ( `Using '${ getInput ( 'author_name' ) } <${ getInput ( 'author_email' ) } >' as author.` )
24
26
}
25
27
You can’t perform that action at this time.
0 commit comments