Skip to content

Commit a96ffa2

Browse files
committed
revert: revert issue with safe directories
1 parent bb65cf3 commit a96ffa2

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

__tests__/git.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('git', () => {
5454
})
5555

5656
await init(action)
57-
expect(execute).toHaveBeenCalledTimes(8)
57+
expect(execute).toHaveBeenCalledTimes(7)
5858
})
5959

6060
it('should catch when a function throws an error', async () => {
@@ -101,7 +101,7 @@ describe('git', () => {
101101
})
102102

103103
await init(action)
104-
expect(execute).toHaveBeenCalledTimes(8)
104+
expect(execute).toHaveBeenCalledTimes(7)
105105
})
106106

107107
it('should not unset git config if a user is using ssh', async () => {
@@ -123,7 +123,7 @@ describe('git', () => {
123123
})
124124

125125
await init(action)
126-
expect(execute).toHaveBeenCalledTimes(7)
126+
expect(execute).toHaveBeenCalledTimes(6)
127127

128128
process.env.CI = undefined
129129
})
@@ -144,7 +144,7 @@ describe('git', () => {
144144
})
145145

146146
await init(action)
147-
expect(execute).toHaveBeenCalledTimes(8)
147+
expect(execute).toHaveBeenCalledTimes(7)
148148
})
149149
})
150150

__tests__/main.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('main', () => {
5353
debug: true
5454
})
5555
await run(action)
56-
expect(execute).toHaveBeenCalledTimes(19)
56+
expect(execute).toHaveBeenCalledTimes(18)
5757
expect(rmRF).toHaveBeenCalledTimes(1)
5858
expect(exportVariable).toHaveBeenCalledTimes(1)
5959
})
@@ -73,7 +73,7 @@ describe('main', () => {
7373
isTest: TestFlag.HAS_CHANGED_FILES
7474
})
7575
await run(action)
76-
expect(execute).toHaveBeenCalledTimes(22)
76+
expect(execute).toHaveBeenCalledTimes(21)
7777
expect(rmRF).toHaveBeenCalledTimes(1)
7878
expect(exportVariable).toHaveBeenCalledTimes(1)
7979
})

src/git.ts

+1-16
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,7 @@ export async function init(action: ActionInterface): Promise<void | Error> {
2424
info('Configuring git…')
2525

2626
/**
27-
* Add safe directory to the global git config.
28-
*/
29-
try {
30-
await execute(
31-
`git config --global safe.directory '*'`,
32-
action.workspace,
33-
action.silent
34-
)
35-
} catch {
36-
info('Unable to set workflow file tree as a safe directory…')
37-
}
38-
39-
/**
40-
* Ensure that the workspace is a safe directory, this is somewhat redundant as the action
41-
* will always set the workspace as a safe directory, but this is a fallback in case the action
42-
* fails to do so.
27+
* Ensure that the workspace is a safe directory.
4328
*/
4429
try {
4530
await execute(

0 commit comments

Comments
 (0)