From a99962b0998b2f808a8868dbdc2aebb3680244b0 Mon Sep 17 00:00:00 2001 From: shigupt202 <57620559+shigupt202@users.noreply.github.com> Date: Wed, 7 Oct 2020 15:02:09 +0530 Subject: [PATCH] Updating file permissions to remove helm security warning (#15) (#16) --- lib/login.js | 1 + src/login.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/login.js b/lib/login.js index cb1b170..797c925 100644 --- a/lib/login.js +++ b/lib/login.js @@ -101,6 +101,7 @@ function run() { const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); fs.writeFileSync(kubeconfigPath, kubeconfig); + fs.chmodSync(kubeconfigPath, '600'); command_1.issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); console.log('KUBECONFIG environment variable is set'); }); diff --git a/src/login.ts b/src/login.ts index 392aa86..fbc48b7 100644 --- a/src/login.ts +++ b/src/login.ts @@ -96,6 +96,7 @@ async function run() { const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`); core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`); fs.writeFileSync(kubeconfigPath, kubeconfig); + fs.chmodSync(kubeconfigPath, '600'); issueCommand('set-env', { name: 'KUBECONFIG' }, kubeconfigPath); console.log('KUBECONFIG environment variable is set'); }