lower permissions for chmod (#51)

This commit is contained in:
Oliver King 2022-05-27 17:36:08 -04:00 committed by GitHub
parent 3866693c1e
commit d449d75495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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();
});

View file

@ -57,7 +57,7 @@ export async function downloadKubectl(version: string): Promise<string> {
}
const kubectlPath = path.join(cachedToolpath, kubectlToolName + getExecutableExtension());
fs.chmodSync(kubectlPath, '777');
fs.chmodSync(kubectlPath, '775');
return kubectlPath;
}