Skip to content

Commit

Permalink
lower permissions for chmod (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverMKing committed May 27, 2022
1 parent 3866693 commit d449d75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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();
});

Expand Down
2 changes: 1 addition & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d449d75

Please sign in to comment.