File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ describe('git', () => {
55
55
} )
56
56
57
57
await init ( action )
58
- expect ( execute ) . toBeCalledTimes ( 6 )
58
+ expect ( execute ) . toBeCalledTimes ( 7 )
59
59
} )
60
60
61
61
it ( 'should catch when a function throws an error' , async ( ) => {
@@ -102,7 +102,7 @@ describe('git', () => {
102
102
} )
103
103
104
104
await init ( action )
105
- expect ( execute ) . toBeCalledTimes ( 6 )
105
+ expect ( execute ) . toBeCalledTimes ( 7 )
106
106
} )
107
107
108
108
it ( 'should not unset git config if a user is using ssh' , async ( ) => {
@@ -124,7 +124,7 @@ describe('git', () => {
124
124
} )
125
125
126
126
await init ( action )
127
- expect ( execute ) . toBeCalledTimes ( 5 )
127
+ expect ( execute ) . toBeCalledTimes ( 6 )
128
128
129
129
process . env . CI = undefined
130
130
} )
@@ -145,7 +145,7 @@ describe('git', () => {
145
145
} )
146
146
147
147
await init ( action )
148
- expect ( execute ) . toBeCalledTimes ( 6 )
148
+ expect ( execute ) . toBeCalledTimes ( 7 )
149
149
} )
150
150
} )
151
151
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ describe('main', () => {
53
53
debug : true
54
54
} )
55
55
await run ( action )
56
- expect ( execute ) . toBeCalledTimes ( 16 )
56
+ expect ( execute ) . toBeCalledTimes ( 17 )
57
57
expect ( rmRF ) . toBeCalledTimes ( 1 )
58
58
expect ( exportVariable ) . toBeCalledTimes ( 1 )
59
59
} )
@@ -73,7 +73,7 @@ describe('main', () => {
73
73
isTest : TestFlag . HAS_CHANGED_FILES
74
74
} )
75
75
await run ( action )
76
- expect ( execute ) . toBeCalledTimes ( 19 )
76
+ expect ( execute ) . toBeCalledTimes ( 20 )
77
77
expect ( rmRF ) . toBeCalledTimes ( 1 )
78
78
expect ( exportVariable ) . toBeCalledTimes ( 1 )
79
79
} )
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ export async function init(action: ActionInterface): Promise<void | Error> {
21
21
info ( `Deploying using ${ action . tokenType } … 🔑` )
22
22
info ( 'Configuring git…' )
23
23
24
+ try {
25
+ await execute (
26
+ `git config --global --add safe.directory "${ action . workspace } "` ,
27
+ action . workspace ,
28
+ action . silent
29
+ )
30
+ } catch {
31
+ info ( 'Unable to set workspace as a safe directory…' )
32
+ }
33
+
24
34
await execute (
25
35
`git config user.name "${ action . name } "` ,
26
36
action . workspace ,
You can’t perform that action at this time.
0 commit comments