File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,23 @@ let GIT_AUTHOR_EMAIL: string;
1717if ( core . getInput ( "commit-author" ) ) {
1818 assert . equal ( core . getInput ( "commit-author-name" ) , "" ) ;
1919 assert . equal ( core . getInput ( "commit-author-email" ) , "" ) ;
20- [ GIT_AUTHOR_NAME , GIT_AUTHOR_EMAIL ] = core
21- . getInput ( "commit-author" )
22- . match ( / ^ \s + ( .+ ) \s + < ( .+ ) > \s + $ / )
23- . slice ( 1 ) ;
20+ if (
21+ / ^ \s + @ ? g i t h u b [ - _ ] ? a c t i o n s (?: \[ b o t \] ) ? \s + $ / . test (
22+ core . getInput ( "commit-author" )
23+ )
24+ ) {
25+ GIT_AUTHOR_NAME = "github-actions[bot]" ;
26+ GIT_AUTHOR_EMAIL =
27+ "41898282+github-actions[bot]@users.noreply.github.com" ;
28+ } else if ( / ^ \s + @ ? m e \s + $ / . test ( core . getInput ( "commit-author" ) ) ) {
29+ GIT_AUTHOR_NAME = process . env . GITHUB_ACTOR ;
30+ GIT_AUTHOR_EMAIL = `${ process . env . GITHUB_ACTOR_ID } +${ process . env . GITHUB_ACTOR } @users.noreply.github.com` ;
31+ } else {
32+ [ GIT_AUTHOR_NAME , GIT_AUTHOR_EMAIL ] = core
33+ . getInput ( "commit-author" )
34+ . match ( / ^ \s + ( .+ ) \s + < ( .+ ) > \s + $ / )
35+ . slice ( 1 ) ;
36+ }
2437} else {
2538 GIT_AUTHOR_NAME = core . getInput ( "commit-author-name" , { required : true } ) ;
2639 GIT_AUTHOR_EMAIL = core . getInput ( "commit-author-email" , { required : true } ) ;
You can’t perform that action at this time.
0 commit comments