From a96ffa23204731ec64e3e1316072197d98bfbaea Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 27 Sep 2024 13:07:36 -0400 Subject: [PATCH] revert: revert issue with safe directories --- __tests__/git.test.ts | 8 ++++---- __tests__/main.test.ts | 4 ++-- src/git.ts | 17 +---------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/__tests__/git.test.ts b/__tests__/git.test.ts index f1c7bc5fa..ddb0b65d2 100644 --- a/__tests__/git.test.ts +++ b/__tests__/git.test.ts @@ -54,7 +54,7 @@ describe('git', () => { }) await init(action) - expect(execute).toHaveBeenCalledTimes(8) + expect(execute).toHaveBeenCalledTimes(7) }) it('should catch when a function throws an error', async () => { @@ -101,7 +101,7 @@ describe('git', () => { }) await init(action) - expect(execute).toHaveBeenCalledTimes(8) + expect(execute).toHaveBeenCalledTimes(7) }) it('should not unset git config if a user is using ssh', async () => { @@ -123,7 +123,7 @@ describe('git', () => { }) await init(action) - expect(execute).toHaveBeenCalledTimes(7) + expect(execute).toHaveBeenCalledTimes(6) process.env.CI = undefined }) @@ -144,7 +144,7 @@ describe('git', () => { }) await init(action) - expect(execute).toHaveBeenCalledTimes(8) + expect(execute).toHaveBeenCalledTimes(7) }) }) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 3d33495aa..f0ec58053 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -53,7 +53,7 @@ describe('main', () => { debug: true }) await run(action) - expect(execute).toHaveBeenCalledTimes(19) + expect(execute).toHaveBeenCalledTimes(18) expect(rmRF).toHaveBeenCalledTimes(1) expect(exportVariable).toHaveBeenCalledTimes(1) }) @@ -73,7 +73,7 @@ describe('main', () => { isTest: TestFlag.HAS_CHANGED_FILES }) await run(action) - expect(execute).toHaveBeenCalledTimes(22) + expect(execute).toHaveBeenCalledTimes(21) expect(rmRF).toHaveBeenCalledTimes(1) expect(exportVariable).toHaveBeenCalledTimes(1) }) diff --git a/src/git.ts b/src/git.ts index f8b9a4e0f..a1e4ea922 100644 --- a/src/git.ts +++ b/src/git.ts @@ -24,22 +24,7 @@ export async function init(action: ActionInterface): Promise { info('Configuring git…') /** - * Add safe directory to the global git config. - */ - try { - await execute( - `git config --global safe.directory '*'`, - action.workspace, - action.silent - ) - } catch { - info('Unable to set workflow file tree as a safe directory…') - } - - /** - * Ensure that the workspace is a safe directory, this is somewhat redundant as the action - * will always set the workspace as a safe directory, but this is a fallback in case the action - * fails to do so. + * Ensure that the workspace is a safe directory. */ try { await execute(