@@ -2713,38 +2713,40 @@ try {
27132713 const branch = _actions_core__WEBPACK_IMPORTED_MODULE_0__ . getInput ( 'branch' ) ;
27142714 const commitMessage = _actions_core__WEBPACK_IMPORTED_MODULE_0__ . getInput ( 'commit_message' ) ;
27152715 const pullArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__ . getInput ( 'pull_args' ) ;
2716+ const addArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__ . getInput ( 'add_args' ) ;
27162717 // log
27172718 console . log ( {
27182719 repository,
27192720 branch,
27202721 commitMessage,
27212722 pullArgs,
2723+ addArgs,
27222724 } ) ;
27232725 if ( ! ( await ( 0 , _src_isFileExists_js__WEBPACK_IMPORTED_MODULE_1__ /* .isFileExist */ . e ) ( repository ) ) ) {
27242726 throw new Error ( "repository directory doesn't exist: " + repository ) ;
27252727 }
27262728 if ( branch . trim ( ) === '' ) {
27272729 throw new Error ( 'branch is a required field' ) ;
27282730 }
2729- await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'add' , '.' ] , repository ) ;
2731+ await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'config' , '--global' , 'user.name' , '"github-actions[bot]"' ] , repository ) ;
2732+ await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'config' , '--global' , 'user.email' , '"41898282+github-actions[bot]@users.noreply.github.com"' ] , repository ) ;
2733+ await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'add' , ...addArgs . split ( ' ' ) ] , repository ) ;
27302734 const diff = await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'diff' , '--staged' , '--name-only' ] , repository ) ;
27312735 if ( diff . trim ( ) === '' ) {
27322736 console . log ( 'Working tree is empty. Nothing to commit.' ) ;
27332737 }
27342738 else {
2739+ await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'fetch' , '--depth=1' ] , repository ) ;
2740+ await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'checkout' , branch ] , repository ) ;
27352741 await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [
2736- '-c' ,
2737- 'user.name="github-actions[bot]"' ,
2738- '-c' ,
2739- 'user.email="41898282+github-actions[bot]@users.noreply.github.com"' ,
27402742 'commit' ,
27412743 '-m' ,
27422744 commitMessage ,
27432745 '--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"' ,
27442746 '--no-verify' ,
27452747 ] , repository ) ;
27462748 await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'pull' , ...pullArgs . split ( ' ' ) ] , repository ) ;
2747- await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'push' , '--no-verify' , 'origin' , branch ] , repository ) ;
2749+ console . log ( await ( 0 , _src_spawnProcess_js__WEBPACK_IMPORTED_MODULE_2__ /* .spawnProcess */ . y ) ( 'git' , [ 'push' , '--no-verify' ] , repository ) ) ;
27482750 }
27492751}
27502752catch ( error ) {
0 commit comments