Compare commits

..

1 Commits

Author SHA1 Message Date
MoChilia
e15b166166 prepare release v1.6.0 2024-01-09 11:08:09 +08:00
204 changed files with 25826 additions and 25817 deletions

View File

@@ -560,9 +560,6 @@ jobs:
This action doesn't implement ```az logout``` by default at the end of execution. However, there is no way to tamper with the credentials or account information because the GitHub-hosted runner is on a VM that will get re-imaged for every customer run, which deletes everything. But if the runner is self-hosted (not provided by GitHub), it is recommended to manually log out at the end of the workflow, as shown below. More details on security of the runners can be found [here](https://docs.github.com/actions/learn-github-actions/security-hardening-for-github-actions#hardening-for-self-hosted-runners). This action doesn't implement ```az logout``` by default at the end of execution. However, there is no way to tamper with the credentials or account information because the GitHub-hosted runner is on a VM that will get re-imaged for every customer run, which deletes everything. But if the runner is self-hosted (not provided by GitHub), it is recommended to manually log out at the end of the workflow, as shown below. More details on security of the runners can be found [here](https://docs.github.com/actions/learn-github-actions/security-hardening-for-github-actions#hardening-for-self-hosted-runners).
> [!WARNING]
> When using self hosted runners it is possible to have multiple runners on a single VM. Currently if your runners share a single user on the VM each runner will share the same credentials. That means in detail that each runner is able to change the permissions of another run. As a workaround we propose to use one single VM user per runner. If you start the runner as a service, do not forget to add the [optional user argument](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service#installing-the-service)
```yaml ```yaml
- name: Azure CLI script - name: Azure CLI script
uses: azure/CLI@v1 uses: azure/CLI@v1

View File

@@ -44,7 +44,7 @@ function cleanup() {
} }
} }
catch (error) { catch (error) {
core.warning(`Login cleanup failed with ${error}. Cleanup will be skipped.`); core.setFailed(`Login cleanup failed with ${error}. Make sure 'az' is installed on the runner. If 'enable-AzPSSession' is true, make sure 'pwsh' is installed on the runner together with Azure PowerShell module.`);
core.debug(error.stack); core.debug(error.stack);
} }
}); });

View File

@@ -48,6 +48,9 @@ exports.setUserAgent = setUserAgent;
function cleanupAzCLIAccounts() { function cleanupAzCLIAccounts() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let azPath = yield io.which("az", true); let azPath = yield io.which("az", true);
if (!azPath) {
throw new Error("Azure CLI is not found in the runner.");
}
core.debug(`Azure CLI path: ${azPath}`); core.debug(`Azure CLI path: ${azPath}`);
core.info("Clearing azure cli accounts from the local cache."); core.info("Clearing azure cli accounts from the local cache.");
yield exec.exec(`"${azPath}"`, ["account", "clear"]); yield exec.exec(`"${azPath}"`, ["account", "clear"]);
@@ -57,6 +60,9 @@ exports.cleanupAzCLIAccounts = cleanupAzCLIAccounts;
function cleanupAzPSAccounts() { function cleanupAzPSAccounts() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let psPath = yield io.which(AzPSUtils_1.AzPSConstants.PowerShell_CmdName, true); let psPath = yield io.which(AzPSUtils_1.AzPSConstants.PowerShell_CmdName, true);
if (!psPath) {
throw new Error("PowerShell is not found in the runner.");
}
core.debug(`PowerShell path: ${psPath}`); core.debug(`PowerShell path: ${psPath}`);
core.debug("Importing Azure PowerShell module."); core.debug("Importing Azure PowerShell module.");
AzPSUtils_1.AzPSUtils.setPSModulePathForGitHubRunner(); AzPSUtils_1.AzPSUtils.setPSModulePathForGitHubRunner();

View File

@@ -10,7 +10,7 @@ async function cleanup() {
} }
} }
catch (error) { catch (error) {
core.warning(`Login cleanup failed with ${error}. Cleanup will be skipped.`); core.setFailed(`Login cleanup failed with ${error}. Make sure 'az' is installed on the runner. If 'enable-AzPSSession' is true, make sure 'pwsh' is installed on the runner together with Azure PowerShell module.`);
core.debug(error.stack); core.debug(error.stack);
} }
} }

View File

@@ -13,6 +13,9 @@ export function setUserAgent(): void {
export async function cleanupAzCLIAccounts(): Promise<void> { export async function cleanupAzCLIAccounts(): Promise<void> {
let azPath = await io.which("az", true); let azPath = await io.which("az", true);
if (!azPath) {
throw new Error("Azure CLI is not found in the runner.");
}
core.debug(`Azure CLI path: ${azPath}`); core.debug(`Azure CLI path: ${azPath}`);
core.info("Clearing azure cli accounts from the local cache."); core.info("Clearing azure cli accounts from the local cache.");
await exec.exec(`"${azPath}"`, ["account", "clear"]); await exec.exec(`"${azPath}"`, ["account", "clear"]);
@@ -20,6 +23,9 @@ export async function cleanupAzCLIAccounts(): Promise<void> {
export async function cleanupAzPSAccounts(): Promise<void> { export async function cleanupAzPSAccounts(): Promise<void> {
let psPath: string = await io.which(AzPSConstants.PowerShell_CmdName, true); let psPath: string = await io.which(AzPSConstants.PowerShell_CmdName, true);
if (!psPath) {
throw new Error("PowerShell is not found in the runner.");
}
core.debug(`PowerShell path: ${psPath}`); core.debug(`PowerShell path: ${psPath}`);
core.debug("Importing Azure PowerShell module."); core.debug("Importing Azure PowerShell module.");
AzPSUtils.setPSModulePathForGitHubRunner(); AzPSUtils.setPSModulePathForGitHubRunner();