From d449d75495d2b9d1463555bb00ca3dca77a42ab6 Mon Sep 17 00:00:00 2001 From: Oliver King Date: Fri, 27 May 2022 17:36:08 -0400 Subject: [PATCH] lower permissions for chmod (#51) --- src/run.test.ts | 4 ++-- src/run.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/run.test.ts b/src/run.test.ts index a25dad2..e82e04a 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -106,7 +106,7 @@ describe('Testing all functions in run file.', () => { expect(toolCache.downloadTool).toBeCalled(); expect(toolCache.cacheFile).toBeCalled(); expect(os.type).toBeCalled(); - expect(fs.chmodSync).toBeCalledWith(path.join('pathToCachedTool', 'kubectl.exe'), '777'); + expect(fs.chmodSync).toBeCalledWith(path.join('pathToCachedTool', 'kubectl.exe'), '775'); }); test('downloadKubectl() - throw DownloadKubectlFailed error when unable to download kubectl', async () => { @@ -144,7 +144,7 @@ describe('Testing all functions in run file.', () => { expect(await run.downloadKubectl('v1.15.0')).toBe(path.join('pathToCachedTool', 'kubectl.exe')); expect(toolCache.find).toBeCalledWith('kubectl', 'v1.15.0'); expect(os.type).toBeCalled(); - expect(fs.chmodSync).toBeCalledWith(path.join('pathToCachedTool', 'kubectl.exe'), '777'); + expect(fs.chmodSync).toBeCalledWith(path.join('pathToCachedTool', 'kubectl.exe'), '775'); expect(toolCache.downloadTool).not.toBeCalled(); }); diff --git a/src/run.ts b/src/run.ts index 5a2d2f6..59ae093 100644 --- a/src/run.ts +++ b/src/run.ts @@ -57,7 +57,7 @@ export async function downloadKubectl(version: string): Promise { } const kubectlPath = path.join(cachedToolpath, kubectlToolName + getExecutableExtension()); - fs.chmodSync(kubectlPath, '777'); + fs.chmodSync(kubectlPath, '775'); return kubectlPath; }