@@ -29,10 +29,24 @@ function init(action) {
2929 try {
3030 ( 0 , core_1 . info ) ( `Deploying using ${ action . tokenType } … 🔑` ) ;
3131 ( 0 , core_1 . info ) ( 'Configuring git…' ) ;
32+ /**
33+ * Add safe directory to the global git config.
34+ */
3235 try {
33- yield ( 0 , execute_1 . execute ) ( `git config --global --add safe.directory " ${ action . workspace } " ` , action . workspace , action . silent ) ;
36+ yield ( 0 , execute_1 . execute ) ( `git config --global safe.directory '*' ` , action . workspace , action . silent ) ;
3437 }
3538 catch ( _a ) {
39+ ( 0 , core_1 . info ) ( 'Unable to set workflow file tree as a safe directory…' ) ;
40+ }
41+ /**
42+ * Ensure that the workspace is a safe directory, this is somewhat redundant as the action
43+ * will always set the workspace as a safe directory, but this is a fallback in case the action
44+ * fails to do so.
45+ */
46+ try {
47+ yield ( 0 , execute_1 . execute ) ( `git config --global --add safe.directory "${ action . workspace } "` , action . workspace , action . silent ) ;
48+ }
49+ catch ( _b ) {
3650 ( 0 , core_1 . info ) ( 'Unable to set workspace as a safe directory…' ) ;
3751 }
3852 yield ( 0 , execute_1 . execute ) ( `git config user.name "${ action . name } "` , action . workspace , action . silent ) ;
@@ -49,7 +63,7 @@ function init(action) {
4963 throw new Error ( ) ;
5064 }
5165 }
52- catch ( _b ) {
66+ catch ( _c ) {
5367 ( 0 , core_1 . info ) ( 'Unable to unset previous git config authentication as it may not exist, continuing…' ) ;
5468 }
5569 try {
@@ -58,7 +72,7 @@ function init(action) {
5872 throw new Error ( ) ;
5973 }
6074 }
61- catch ( _c ) {
75+ catch ( _d ) {
6276 ( 0 , core_1 . info ) ( 'Attempted to remove origin but failed, continuing…' ) ;
6377 }
6478 yield ( 0 , execute_1 . execute ) ( `git remote add origin ${ action . repositoryPath } ` , action . workspace , action . silent ) ;
0 commit comments