@@ -29,10 +29,24 @@ function init(action) {
29
29
try {
30
30
( 0 , core_1 . info ) ( `Deploying using ${ action . tokenType } … 🔑` ) ;
31
31
( 0 , core_1 . info ) ( 'Configuring git…' ) ;
32
+ /**
33
+ * Add safe directory to the global git config.
34
+ */
32
35
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 ) ;
34
37
}
35
38
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 ) {
36
50
( 0 , core_1 . info ) ( 'Unable to set workspace as a safe directory…' ) ;
37
51
}
38
52
yield ( 0 , execute_1 . execute ) ( `git config user.name "${ action . name } "` , action . workspace , action . silent ) ;
@@ -49,7 +63,7 @@ function init(action) {
49
63
throw new Error ( ) ;
50
64
}
51
65
}
52
- catch ( _b ) {
66
+ catch ( _c ) {
53
67
( 0 , core_1 . info ) ( 'Unable to unset previous git config authentication as it may not exist, continuing…' ) ;
54
68
}
55
69
try {
@@ -58,7 +72,7 @@ function init(action) {
58
72
throw new Error ( ) ;
59
73
}
60
74
}
61
- catch ( _c ) {
75
+ catch ( _d ) {
62
76
( 0 , core_1 . info ) ( 'Attempted to remove origin but failed, continuing…' ) ;
63
77
}
64
78
yield ( 0 , execute_1 . execute ) ( `git remote add origin ${ action . repositoryPath } ` , action . workspace , action . silent ) ;
0 commit comments