Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 new release #69

Merged
merged 10 commits into from
Jun 16, 2022
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You must run [Azure/login](https://github.com/Azure/login) before this action.
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- uses: azure/aks-set-context@v2.0
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
cluster-name: "<cluster name>"
Expand All @@ -60,7 +60,7 @@ You must run [Azure/login](https://github.com/Azure/login) before this action.
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: azure/aks-set-context@v2.0
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
cluster-name: "<cluster name>"
Expand Down Expand Up @@ -91,7 +91,7 @@ If you are executing this Action as a non-admin user, you need to toggle the opt
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- uses: azure/aks-set-context@v2.0
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
cluster-name: "<cluster name>"
Expand All @@ -103,7 +103,7 @@ If you are executing this Action as a non-admin user, you need to toggle the opt
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: azure/aks-set-context@v2.0
- uses: azure/aks-set-context@v2
with:
resource-group: "<resource group name>"
cluster-name: "<cluster name>"
Expand Down
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,10 @@ function run() {
const exitCode = yield exec.exec(AZ_TOOL_NAME, cmd);
if (exitCode !== 0)
throw Error("az cli exited with error code " + exitCode);
fs.chmodSync(kubeconfigPath, "600");
// export variable
core.exportVariable("KUBECONFIG", kubeconfigPath);
core.debug("KUBECONFIG environment variable set");
if (useKubeLogin) {
const kubeloginCmd = [
"convert-kubeconfig",
Expand All @@ -1721,10 +1725,6 @@ function run() {
if (kubeloginExitCode !== 0)
throw Error("kubelogin exited with error code " + exitCode);
}
fs.chmodSync(kubeconfigPath, "600");
// export variable
core.exportVariable("KUBECONFIG", kubeconfigPath);
core.debug("KUBECONFIG environment variable set");
});
}
exports.run = run;
Expand Down
12 changes: 6 additions & 6 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export async function run() {
const exitCode = await exec.exec(AZ_TOOL_NAME, cmd);
if (exitCode !== 0) throw Error("az cli exited with error code " + exitCode);

fs.chmodSync(kubeconfigPath, "600");

// export variable
core.exportVariable("KUBECONFIG", kubeconfigPath);
core.debug("KUBECONFIG environment variable set");

if (useKubeLogin) {
const kubeloginCmd = [
"convert-kubeconfig",
Expand All @@ -57,12 +63,6 @@ export async function run() {
const kubeloginExitCode = await exec.exec(KUBELOGIN_TOOL_NAME, kubeloginCmd);
if (kubeloginExitCode !== 0) throw Error("kubelogin exited with error code " + exitCode);
}

fs.chmodSync(kubeconfigPath, "600");

// export variable
core.exportVariable("KUBECONFIG", kubeconfigPath);
core.debug("KUBECONFIG environment variable set");
}

run().catch(core.setFailed);