From 2102d71a5f8a5c4df4ceda0ff50f34af94a829e2 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 22 May 2025 17:45:46 -0700 Subject: [PATCH 01/41] Add labels support --- README.md | 2 ++ action.yml | 14 ++++++++++++-- azurecontainerapps.ts | 41 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 67d29d5..7ef2a06 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,8 @@ For more information on the structure of the YAML configuration file, please vis | `environmentVariables` | No | A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret. | | `ingress` | No | Possible options: external, internal, disabled. If set to "external" (default value if not provided when creating a Container App), the Container App will be visible from the internet or a VNET, depending on the app environment endpoint configured. If set to "internal", the Container App will be visible from within the app environment only. If set to "disabled", ingress will be disabled for this Container App and will not have an HTTP or TCP endpoint. | | `disableTelemetry` | No | If set to `true`, no telemetry will be collected by this GitHub Action. If set to `false`, or if this argument is not provided, telemetry will be sent to Microsoft about the Container App build and deploy scenario targeted by this GitHub Action. | +| `RevisionsMode` | No | The revisions mode to set for the Azure Container App. Will be injected into the YAML config under `properties.configuration.revisionsMode` if provided. | +| `TargetLabel` | No | The target label for ingress traffic. Will be injected into the YAML config under `properties.configuration.ingress.targetLabel` if provided and ingress exists. | ## Usage diff --git a/action.yml b/action.yml index e4f0068..f071c65 100644 --- a/action.yml +++ b/action.yml @@ -138,8 +138,18 @@ inputs: not provided, telemetry will be sent to Microsoft about the Container App build and deploy scenario targeted by this GitHub Action.' required: false - default: false - + default: 'false' + revisionsMode: + description: | + 'Specifies the revision mode for the Azure Container App. Possible values are "single" or "labels". If set to + "single", only one revision will be active at a time. If set to "labels", multiple revisions can be active + simultaneously. Default is "single".' + required: false + targetLabel: + description: | + 'Specifies the target label for the Azure Container App revision. This is used to direct traffic to a specific + revision. If not provided, the default revision will be used.' + required: false runs: using: 'node16' main: 'dist/index.js' diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 93739e7..04ec44a 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -106,6 +106,8 @@ export class azurecontainerapps { private static buildArguments: string; private static noIngressUpdate: boolean; private static useInternalRegistry: boolean; + private static revisionsMode: string; + private static targetLabel: string; /** * Initializes the helpers used by this task. @@ -163,6 +165,12 @@ export class azurecontainerapps { // Get the user defined build arguments, if provided this.buildArguments = this.toolHelper.getInput('buildArguments', false); + // Get the RevisionsMode input + this.revisionsMode = this.toolHelper.getInput('revisionsMode', false); + + // Get the TargetLabel input + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + // Ensure that one of appSourcePath, imageToDeploy, or yamlConfigPath is provided if (this.util.isNullOrEmpty(this.appSourcePath) && this.util.isNullOrEmpty(this.imageToDeploy) && this.util.isNullOrEmpty(this.yamlConfigPath)) { let requiredArgumentMessage = `One of the following arguments must be provided: 'appSourcePath', 'imageToDeploy', or 'yamlConfigPath'.`; @@ -170,11 +178,24 @@ export class azurecontainerapps { throw Error(requiredArgumentMessage); } - // Ensure that an ACR name and registry URL are not both provided - if (!this.util.isNullOrEmpty(this.acrName) && !this.util.isNullOrEmpty(this.registryUrl)) { - let conflictingArgumentsMessage = `The 'acrName' and 'registryUrl' arguments cannot both be provided.`; - this.toolHelper.writeError(conflictingArgumentsMessage); - throw Error(conflictingArgumentsMessage); + // Get the revisionsMode input + const normalizedRevisionsMode = this.util.isNullOrEmpty(this.revisionsMode) + ? '' + : this.revisionsMode.toLowerCase(); + + // Ensure that revisionsMode is either 'single' or 'labels' + const validModes = ['single', 'labels']; + if (!this.util.isNullOrEmpty(normalizedRevisionsMode) && !validModes.includes(normalizedRevisionsMode)) { + const invalidRevisionsModeMessage = `The 'revisionsMode' argument must be either 'single' or 'labels'.`; + this.toolHelper.writeError(invalidRevisionsModeMessage); + throw new Error(invalidRevisionsModeMessage); + } + + // Validate targetLabel requirements based on normalized revisionsMode + if (normalizedRevisionsMode === 'labels' && this.util.isNullOrEmpty(this.targetLabel)) { + const missingLabelMessage = `The 'targetLabel' argument must be provided when 'revisionsMode' is set to 'labels'.`; + this.toolHelper.writeError(missingLabelMessage); + throw new Error(missingLabelMessage); } // Set up the build arguments to pass to the Dockerfile or builder @@ -567,6 +588,16 @@ export class azurecontainerapps { `--registry-password ${this.registryPassword}`); } + // Add RevisionsMode to the command-line arguments if provided + if (!this.util.isNullOrEmpty(this.revisionsMode)) { + this.commandLineArgs.push(`--revisions-mode ${this.revisionsMode}`); + } + + // Add TargetLabel to the command-line arguments if provided + if (!this.util.isNullOrEmpty(this.targetLabel)) { + this.commandLineArgs.push(`--label ${this.targetLabel}`); + } + // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario if (!this.containerAppExists) { this.ingressEnabled = true; From 97f7dce1c4e0a7b657171be2461944ee0295b54b Mon Sep 17 00:00:00 2001 From: William Date: Tue, 27 May 2025 16:47:06 -0700 Subject: [PATCH 02/41] Remove RevisionMode --- README.md | 1 - action.yml | 6 ------ azurecontainerapps.ts | 32 -------------------------------- 3 files changed, 39 deletions(-) diff --git a/README.md b/README.md index 7ef2a06..1114c39 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,6 @@ For more information on the structure of the YAML configuration file, please vis | `environmentVariables` | No | A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret. | | `ingress` | No | Possible options: external, internal, disabled. If set to "external" (default value if not provided when creating a Container App), the Container App will be visible from the internet or a VNET, depending on the app environment endpoint configured. If set to "internal", the Container App will be visible from within the app environment only. If set to "disabled", ingress will be disabled for this Container App and will not have an HTTP or TCP endpoint. | | `disableTelemetry` | No | If set to `true`, no telemetry will be collected by this GitHub Action. If set to `false`, or if this argument is not provided, telemetry will be sent to Microsoft about the Container App build and deploy scenario targeted by this GitHub Action. | -| `RevisionsMode` | No | The revisions mode to set for the Azure Container App. Will be injected into the YAML config under `properties.configuration.revisionsMode` if provided. | | `TargetLabel` | No | The target label for ingress traffic. Will be injected into the YAML config under `properties.configuration.ingress.targetLabel` if provided and ingress exists. | ## Usage diff --git a/action.yml b/action.yml index f071c65..a133d16 100644 --- a/action.yml +++ b/action.yml @@ -139,12 +139,6 @@ inputs: this GitHub Action.' required: false default: 'false' - revisionsMode: - description: | - 'Specifies the revision mode for the Azure Container App. Possible values are "single" or "labels". If set to - "single", only one revision will be active at a time. If set to "labels", multiple revisions can be active - simultaneously. Default is "single".' - required: false targetLabel: description: | 'Specifies the target label for the Azure Container App revision. This is used to direct traffic to a specific diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 04ec44a..1a5e722 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -106,7 +106,6 @@ export class azurecontainerapps { private static buildArguments: string; private static noIngressUpdate: boolean; private static useInternalRegistry: boolean; - private static revisionsMode: string; private static targetLabel: string; /** @@ -165,12 +164,6 @@ export class azurecontainerapps { // Get the user defined build arguments, if provided this.buildArguments = this.toolHelper.getInput('buildArguments', false); - // Get the RevisionsMode input - this.revisionsMode = this.toolHelper.getInput('revisionsMode', false); - - // Get the TargetLabel input - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - // Ensure that one of appSourcePath, imageToDeploy, or yamlConfigPath is provided if (this.util.isNullOrEmpty(this.appSourcePath) && this.util.isNullOrEmpty(this.imageToDeploy) && this.util.isNullOrEmpty(this.yamlConfigPath)) { let requiredArgumentMessage = `One of the following arguments must be provided: 'appSourcePath', 'imageToDeploy', or 'yamlConfigPath'.`; @@ -178,26 +171,6 @@ export class azurecontainerapps { throw Error(requiredArgumentMessage); } - // Get the revisionsMode input - const normalizedRevisionsMode = this.util.isNullOrEmpty(this.revisionsMode) - ? '' - : this.revisionsMode.toLowerCase(); - - // Ensure that revisionsMode is either 'single' or 'labels' - const validModes = ['single', 'labels']; - if (!this.util.isNullOrEmpty(normalizedRevisionsMode) && !validModes.includes(normalizedRevisionsMode)) { - const invalidRevisionsModeMessage = `The 'revisionsMode' argument must be either 'single' or 'labels'.`; - this.toolHelper.writeError(invalidRevisionsModeMessage); - throw new Error(invalidRevisionsModeMessage); - } - - // Validate targetLabel requirements based on normalized revisionsMode - if (normalizedRevisionsMode === 'labels' && this.util.isNullOrEmpty(this.targetLabel)) { - const missingLabelMessage = `The 'targetLabel' argument must be provided when 'revisionsMode' is set to 'labels'.`; - this.toolHelper.writeError(missingLabelMessage); - throw new Error(missingLabelMessage); - } - // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' @@ -588,11 +561,6 @@ export class azurecontainerapps { `--registry-password ${this.registryPassword}`); } - // Add RevisionsMode to the command-line arguments if provided - if (!this.util.isNullOrEmpty(this.revisionsMode)) { - this.commandLineArgs.push(`--revisions-mode ${this.revisionsMode}`); - } - // Add TargetLabel to the command-line arguments if provided if (!this.util.isNullOrEmpty(this.targetLabel)) { this.commandLineArgs.push(`--label ${this.targetLabel}`); From 00efeea634d508e5de733e27158aa397eb2a978c Mon Sep 17 00:00:00 2001 From: William Date: Tue, 27 May 2025 16:49:19 -0700 Subject: [PATCH 03/41] Revert accidental deletion --- azurecontainerapps.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 1a5e722..8b28c71 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -171,6 +171,13 @@ export class azurecontainerapps { throw Error(requiredArgumentMessage); } + // Ensure that an ACR name and registry URL are not both provided + if (!this.util.isNullOrEmpty(this.acrName) && !this.util.isNullOrEmpty(this.registryUrl)) { + let conflictingArgumentsMessage = `The 'acrName' and 'registryUrl' arguments cannot both be provided.`; + this.toolHelper.writeError(conflictingArgumentsMessage); + throw Error(conflictingArgumentsMessage); + } + // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' From 9117bd5e892cda1e7bcef190b8ccecf5bcc31e9a Mon Sep 17 00:00:00 2001 From: William Date: Wed, 28 May 2025 10:21:34 -0700 Subject: [PATCH 04/41] Update azure login to use UAMI with OIDC --- .github/workflows/run-validation.yml | 117 +++++++++++++++++---------- 1 file changed, 74 insertions(+), 43 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 43e2a91..ad8a495 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -27,6 +27,10 @@ jobs: TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -37,10 +41,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -65,7 +71,6 @@ jobs: shell: bash run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - create-using-builder-and-internal-registry: name: 'Create app using builder and push to internal registry' @@ -86,10 +91,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -125,10 +132,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -173,10 +182,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -216,10 +227,12 @@ jobs: - name: Checkout action repository uses: actions/checkout@v3 - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -248,10 +261,12 @@ jobs: - name: Checkout action repository uses: actions/checkout@v3 - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -281,10 +296,12 @@ jobs: - name: Checkout action repository uses: actions/checkout@v3 - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -346,10 +363,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Update values in YAML configuration file shell: pwsh @@ -406,10 +425,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Update values in YAML configuration file shell: pwsh @@ -451,10 +472,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Update values in YAML configuration file shell: pwsh @@ -496,10 +519,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -544,10 +569,12 @@ jobs: repository: microsoft/Oryx path: oryx - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -575,10 +602,12 @@ jobs: - name: Checkout action repository uses: actions/checkout@v3 - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Execute Azure Container Apps Build and Deploy Action uses: ./ @@ -603,10 +632,12 @@ jobs: - name: Checkout action repository uses: actions/checkout@v3 - - name: Log in to Azure - uses: azure/login@v1 + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 with: - creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Update values in YAML configuration file shell: pwsh From 46091a57b786640966e241ade34386126ddc0036 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 28 May 2025 10:22:16 -0700 Subject: [PATCH 05/41] Test update --- .github/workflows/run-validation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index ad8a495..d543a1f 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -4,11 +4,13 @@ on: push: branches: - main + - williamhe/add-labels-support paths-ignore: - '**.md' pull_request: branches: - main + - williamhe/add-labels-support paths-ignore: - '**.md' From 6196c0df8f61eb07310f488be6231203f7e0d4be Mon Sep 17 00:00:00 2001 From: William Date: Wed, 28 May 2025 11:54:36 -0700 Subject: [PATCH 06/41] Update description --- README.md | 2 +- action.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1114c39..c26f96f 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ For more information on the structure of the YAML configuration file, please vis | `environmentVariables` | No | A list of environment variable(s) for the container. Space-separated values in 'key=value' format. Empty string to clear existing values. Prefix value with 'secretref:' to reference a secret. | | `ingress` | No | Possible options: external, internal, disabled. If set to "external" (default value if not provided when creating a Container App), the Container App will be visible from the internet or a VNET, depending on the app environment endpoint configured. If set to "internal", the Container App will be visible from within the app environment only. If set to "disabled", ingress will be disabled for this Container App and will not have an HTTP or TCP endpoint. | | `disableTelemetry` | No | If set to `true`, no telemetry will be collected by this GitHub Action. If set to `false`, or if this argument is not provided, telemetry will be sent to Microsoft about the Container App build and deploy scenario targeted by this GitHub Action. | -| `TargetLabel` | No | The target label for ingress traffic. Will be injected into the YAML config under `properties.configuration.ingress.targetLabel` if provided and ingress exists. | +| `TargetLabel` | No | The target label for new revisions. Will be injected into the YAML config under `properties.configuration.targetLabel` if provided. | ## Usage diff --git a/action.yml b/action.yml index a133d16..d1206b1 100644 --- a/action.yml +++ b/action.yml @@ -141,8 +141,8 @@ inputs: default: 'false' targetLabel: description: | - 'Specifies the target label for the Azure Container App revision. This is used to direct traffic to a specific - revision. If not provided, the default revision will be used.' + 'Specifies the target label for the Azure Container App revision. + This will replace any prior revision with the given label. This is required when using ActiveRevisionMode: Labels.' required: false runs: using: 'node16' From 8473536fd999fb19cfdfe5f2f9365b47d8df91f2 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 28 May 2025 11:55:55 -0700 Subject: [PATCH 07/41] Update arg --- azurecontainerapps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 8b28c71..95f4909 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -570,7 +570,7 @@ export class azurecontainerapps { // Add TargetLabel to the command-line arguments if provided if (!this.util.isNullOrEmpty(this.targetLabel)) { - this.commandLineArgs.push(`--label ${this.targetLabel}`); + this.commandLineArgs.push(`--targetLabel ${this.targetLabel}`); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario From a60e1010b37ba77bb7e680b6456a3eecfbe57851 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 11:47:01 -0700 Subject: [PATCH 08/41] Add permissions --- .github/workflows/run-validation.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index d543a1f..341b8b1 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -225,6 +225,10 @@ jobs: env: TEST_CONTAINER_APP_NAME: 'gh-ca-is-lin-${{ github.run_id }}' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 From 805e618de7fb58b8d5a8217803cdb6b66d70a725 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 11:59:12 -0700 Subject: [PATCH 09/41] Add permissions --- .github/workflows/run-validation.yml | 731 ++++++++++++++------------- 1 file changed, 379 insertions(+), 352 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 341b8b1..4212756 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -19,202 +19,361 @@ env: TEST_IMAGE_REPOSITORY: github-actions/container-app jobs: - create-using-builder: - - name: 'Create app using builder' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - permissions: - id-token: write - contents: read - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - create-using-builder-and-internal-registry: - - name: 'Create app using builder and push to internal registry' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -y - - - create-using-found-dockerfile: - - name: 'Create app using found Dockerfile' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - create-using-provided-dockerfile: - - name: 'Create app using provided Dockerfile' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - dockerfilePath: 'Dockerfile' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - + # create-using-builder: + + # name: 'Create app using builder' + # runs-on: ubuntu-latest + # timeout-minutes: 10 + + # env: + # TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' + # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' + + # permissions: + # id-token: write + # contents: read + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Clone Oryx repository + # uses: actions/checkout@v3 + # with: + # repository: microsoft/Oryx + # path: oryx + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' + # acrName: ${{ vars.TEST_ACR_NAME }} + # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # - name: Delete pushed image + # if: ${{ always() }} + # shell: bash + # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y + + # create-using-builder-and-internal-registry: + + # name: 'Create app using builder and push to internal registry' + # runs-on: ubuntu-latest + # timeout-minutes: 10 + + # env: + # TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' + # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Clone Oryx repository + # uses: actions/checkout@v3 + # with: + # repository: microsoft/Oryx + # path: oryx + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -y + + + # create-using-found-dockerfile: + + # name: 'Create app using found Dockerfile' + # runs-on: ubuntu-latest + # timeout-minutes: 10 + + # env: + # TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' + # TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Clone Oryx repository + # uses: actions/checkout@v3 + # with: + # repository: microsoft/Oryx + # path: oryx + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' + # acrName: ${{ vars.TEST_ACR_NAME }} + # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # - name: Delete pushed image + # if: ${{ always() }} + # shell: bash + # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y + + # create-using-provided-dockerfile: + + # name: 'Create app using provided Dockerfile' + # runs-on: ubuntu-latest + # timeout-minutes: 10 + + # env: + # TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' + # TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Clone Oryx repository + # uses: actions/checkout@v3 + # with: + # repository: microsoft/Oryx + # path: oryx + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' + # dockerfilePath: 'Dockerfile' + # acrName: ${{ vars.TEST_ACR_NAME }} + # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # - name: Delete pushed image + # if: ${{ always() }} + # shell: bash + # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y + + + + + # create-using-image-windows: + + # name: 'Create app using image on Windows runner' + # runs-on: windows-latest + # timeout-minutes: 10 + + # env: + # TEST_CONTAINER_APP_NAME: 'gh-ca-is-win-${{ github.run_id }}' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # create-using-image-new-env: + + # name: 'Create app using image with new environment' + # runs-on: ubuntu-latest + # timeout-minutes: 25 + + # env: + # TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' + # TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # - name: Get customer ID for workspace to delete + # if: ${{ always() }} + # shell: bash + # run: | + # CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId') + # echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV + + # - name: Get name of workspace to delete + # if: ${{ always() }} + # shell: bash + # run: | + # WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]') + # echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV + + # - name: Delete created Azure Container App environment + # if: ${{ always() }} + # shell: bash + # run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y + + # - name: Delete created workspace + # if: ${{ always() }} + # shell: bash + # run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y + + + # create-using-builder-yaml: + + # name: 'Create app using builder with YAML configuration' + # runs-on: ubuntu-latest + # timeout-minutes: 10 + + # env: + # TEST_IMAGE_TAG: 'bs-yaml-${{ github.run_id }}' + # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-${{ github.run_id }}' + # TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml' + + # steps: + # - name: Checkout action repository + # uses: actions/checkout@v3 + + # - name: Clone Oryx repository + # uses: actions/checkout@v3 + # with: + # repository: microsoft/Oryx + # path: oryx + + # - name: Log in to Azure using UAMI with OIDC + # uses: azure/login@v2 + # with: + # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + # tenant-id: ${{ secrets.AZURE_TENANT_ID }} + # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + # - name: Update values in YAML configuration file + # shell: pwsh + # run: | + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$FULL_ACR_NAME$', '${{ env.TEST_FULL_ACR_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_USERNAME$', '${{ secrets.TEST_REGISTRY_USERNAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_PASSWORD$', '${{ secrets.TEST_REGISTRY_PASSWORD }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_REPOSITORY$', '${{ env.TEST_IMAGE_REPOSITORY }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_TAG$', '${{ env.TEST_IMAGE_TAG }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} + + # - name: Execute Azure Container Apps Build and Deploy Action + # uses: ./ + # with: + # yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} + # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' + # acrName: ${{ vars.TEST_ACR_NAME }} + # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + # - name: Delete pushed image + # if: ${{ always() }} + # shell: bash + # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y create-using-image-linux: @@ -254,162 +413,6 @@ jobs: shell: bash run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - create-using-image-windows: - - name: 'Create app using image on Windows runner' - runs-on: windows-latest - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-is-win-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - create-using-image-new-env: - - name: 'Create app using image with new environment' - runs-on: ubuntu-latest - timeout-minutes: 25 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' - TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Get customer ID for workspace to delete - if: ${{ always() }} - shell: bash - run: | - CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId') - echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV - - - name: Get name of workspace to delete - if: ${{ always() }} - shell: bash - run: | - WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]') - echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV - - - name: Delete created Azure Container App environment - if: ${{ always() }} - shell: bash - run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y - - - name: Delete created workspace - if: ${{ always() }} - shell: bash - run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y - - - create-using-builder-yaml: - - name: 'Create app using builder with YAML configuration' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-yaml-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-${{ github.run_id }}' - TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Update values in YAML configuration file - shell: pwsh - run: | - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$FULL_ACR_NAME$', '${{ env.TEST_FULL_ACR_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_USERNAME$', '${{ secrets.TEST_REGISTRY_USERNAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_PASSWORD$', '${{ secrets.TEST_REGISTRY_PASSWORD }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_REPOSITORY$', '${{ env.TEST_IMAGE_REPOSITORY }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_TAG$', '${{ env.TEST_IMAGE_TAG }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y create-using-image-yaml-linux: @@ -421,6 +424,10 @@ jobs: TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-lin-${{ github.run_id }}' TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-image-simple.yaml' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -468,6 +475,10 @@ jobs: TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-win-${{ github.run_id }}' TEST_YAML_FILE_PATH: 'yaml-samples/create-with-image-simple.yaml' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -515,6 +526,10 @@ jobs: TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' TEST_CONTAINER_APP_NAME: 'update-using-builder-app' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -565,6 +580,10 @@ jobs: TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' TEST_CONTAINER_APP_NAME: 'update-using-builder-app' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -604,6 +623,10 @@ jobs: env: TEST_CONTAINER_APP_NAME: 'update-using-image-app' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -634,6 +657,10 @@ jobs: TEST_CONTAINER_APP_NAME: 'update-using-image-yaml-app' TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/update-with-image-simple.yaml' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 From 6cbe52c9fa87096e97b356cb7d442d5af3bb315e Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 16:03:40 -0700 Subject: [PATCH 10/41] Remove builder steps --- .github/workflows/run-validation.yml | 454 --------------------------- 1 file changed, 454 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 4212756..90cfcc1 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -19,362 +19,6 @@ env: TEST_IMAGE_REPOSITORY: github-actions/container-app jobs: - # create-using-builder: - - # name: 'Create app using builder' - # runs-on: ubuntu-latest - # timeout-minutes: 10 - - # env: - # TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - # permissions: - # id-token: write - # contents: read - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Clone Oryx repository - # uses: actions/checkout@v3 - # with: - # repository: microsoft/Oryx - # path: oryx - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - # acrName: ${{ vars.TEST_ACR_NAME }} - # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # - name: Delete pushed image - # if: ${{ always() }} - # shell: bash - # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - # create-using-builder-and-internal-registry: - - # name: 'Create app using builder and push to internal registry' - # runs-on: ubuntu-latest - # timeout-minutes: 10 - - # env: - # TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Clone Oryx repository - # uses: actions/checkout@v3 - # with: - # repository: microsoft/Oryx - # path: oryx - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -y - - - # create-using-found-dockerfile: - - # name: 'Create app using found Dockerfile' - # runs-on: ubuntu-latest - # timeout-minutes: 10 - - # env: - # TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' - # TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Clone Oryx repository - # uses: actions/checkout@v3 - # with: - # repository: microsoft/Oryx - # path: oryx - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - # acrName: ${{ vars.TEST_ACR_NAME }} - # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # - name: Delete pushed image - # if: ${{ always() }} - # shell: bash - # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - # create-using-provided-dockerfile: - - # name: 'Create app using provided Dockerfile' - # runs-on: ubuntu-latest - # timeout-minutes: 10 - - # env: - # TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' - # TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Clone Oryx repository - # uses: actions/checkout@v3 - # with: - # repository: microsoft/Oryx - # path: oryx - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - # dockerfilePath: 'Dockerfile' - # acrName: ${{ vars.TEST_ACR_NAME }} - # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # - name: Delete pushed image - # if: ${{ always() }} - # shell: bash - # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - - - - # create-using-image-windows: - - # name: 'Create app using image on Windows runner' - # runs-on: windows-latest - # timeout-minutes: 10 - - # env: - # TEST_CONTAINER_APP_NAME: 'gh-ca-is-win-${{ github.run_id }}' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # create-using-image-new-env: - - # name: 'Create app using image with new environment' - # runs-on: ubuntu-latest - # timeout-minutes: 25 - - # env: - # TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' - # TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # - name: Get customer ID for workspace to delete - # if: ${{ always() }} - # shell: bash - # run: | - # CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId') - # echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV - - # - name: Get name of workspace to delete - # if: ${{ always() }} - # shell: bash - # run: | - # WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]') - # echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV - - # - name: Delete created Azure Container App environment - # if: ${{ always() }} - # shell: bash - # run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y - - # - name: Delete created workspace - # if: ${{ always() }} - # shell: bash - # run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y - - - # create-using-builder-yaml: - - # name: 'Create app using builder with YAML configuration' - # runs-on: ubuntu-latest - # timeout-minutes: 10 - - # env: - # TEST_IMAGE_TAG: 'bs-yaml-${{ github.run_id }}' - # TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-${{ github.run_id }}' - # TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml' - - # steps: - # - name: Checkout action repository - # uses: actions/checkout@v3 - - # - name: Clone Oryx repository - # uses: actions/checkout@v3 - # with: - # repository: microsoft/Oryx - # path: oryx - - # - name: Log in to Azure using UAMI with OIDC - # uses: azure/login@v2 - # with: - # client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - # - name: Update values in YAML configuration file - # shell: pwsh - # run: | - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$FULL_ACR_NAME$', '${{ env.TEST_FULL_ACR_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_USERNAME$', '${{ secrets.TEST_REGISTRY_USERNAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_PASSWORD$', '${{ secrets.TEST_REGISTRY_PASSWORD }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_REPOSITORY$', '${{ env.TEST_IMAGE_REPOSITORY }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - # (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_TAG$', '${{ env.TEST_IMAGE_TAG }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - # - name: Execute Azure Container Apps Build and Deploy Action - # uses: ./ - # with: - # yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - # appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - # acrName: ${{ vars.TEST_ACR_NAME }} - # acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - # acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - # containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - # resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - # imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - # disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - # - name: Delete pushed image - # if: ${{ always() }} - # shell: bash - # run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - create-using-image-linux: name: 'Create app using image on Linux runner' @@ -516,104 +160,6 @@ jobs: shell: bash run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - update-using-builder: - - name: 'Update existing app using builder' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'update-using-builder-app' - - permissions: - id-token: write - contents: read - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - - name: Update Container App with existing image - if: ${{ always() }} - shell: bash - run: az containerapp update -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -i mcr.microsoft.com/azuredocs/containerapps-helloworld:latest - - update-using-builder-and-internal-registry: - - name: 'Update existing app using builder and push to internal registry' - runs-on: ubuntu-latest - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'update-using-builder-app' - - permissions: - id-token: write - contents: read - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Log in to Azure using UAMI with OIDC - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Update Container App with existing image - if: ${{ always() }} - shell: bash - run: az containerapp update -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -i mcr.microsoft.com/azuredocs/containerapps-helloworld:latest - update-using-image: name: 'Update app using image' From 612d251b84a6066d44898326219a09fd5ba18d04 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 16:49:16 -0700 Subject: [PATCH 11/41] Add target labels params --- .github/workflows/run-validation.yml | 4 +++- azurecontainerapps.ts | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 90cfcc1..901882a 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -51,6 +51,7 @@ jobs: containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + targetLabel: ${{ vars.TEST_TARGET_LABEL }} - name: Delete created Azure Container App if: ${{ always() }} @@ -103,11 +104,12 @@ jobs: containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + targetLabel: ${{ vars.TEST_TARGET_LABEL }} - name: Delete created Azure Container App if: ${{ always() }} shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} 'gh-action-test' -y create-using-image-yaml-windows: diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 95f4909..576eb99 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -224,6 +224,9 @@ export class azurecontainerapps { // Get the resource group to deploy to if it was provided, or generate it from the Container App name this.resourceGroup = await this.getOrCreateResourceGroup(this.containerAppName, this.location); + // Get the target label to use for the Container App, if provided + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + // Determine if the Container Appp currently exists this.containerAppExists = await this.appHelper.doesContainerAppExist(this.containerAppName, this.resourceGroup); @@ -625,7 +628,11 @@ export class azurecontainerapps { this.commandLineArgs.push(`-i ${this.imageToDeploy}`); } else if (!this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry) { this.commandLineArgs.push(`--source ${this.appSourcePath}`); + } else if (!this.util.isNullOrEmpty(this.targetLabel)) { + // If the target label is provided, add it to the command line arguments + this.commandLineArgs.push(`--target_label ${this.targetLabel}`); } + } /** From 2cfa386549f36b3aceba9501b886333717f41d50 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 16:54:42 -0700 Subject: [PATCH 12/41] Test commi --- .github/workflows/run-validation.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 901882a..e82e000 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -10,7 +10,6 @@ on: pull_request: branches: - main - - williamhe/add-labels-support paths-ignore: - '**.md' @@ -53,10 +52,10 @@ jobs: disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} targetLabel: ${{ vars.TEST_TARGET_LABEL }} - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + # - name: Delete created Azure Container App + # if: ${{ always() }} + # shell: bash + # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y create-using-image-yaml-linux: From 75d9c5cce838899cb7d766f7d433501c96c5fee2 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 17:43:01 -0700 Subject: [PATCH 13/41] Add active revisions mode param --- azurecontainerapps.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 576eb99..b613af4 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -630,7 +630,9 @@ export class azurecontainerapps { this.commandLineArgs.push(`--source ${this.appSourcePath}`); } else if (!this.util.isNullOrEmpty(this.targetLabel)) { // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push(`--target_label ${this.targetLabel}`); + this.commandLineArgs.push(`--revisions-mode Labels`); + this.commandLineArgs.push(`--target-label ${this.targetLabel}`); + } } From adde5e7f4b756bbbfef8569be199c320349e5b44 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 17:48:02 -0700 Subject: [PATCH 14/41] Add active revisions mode param --- .github/workflows/run-validation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index e82e000..191c4f5 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -50,6 +50,7 @@ jobs: containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + activeRevisionMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} # - name: Delete created Azure Container App From a8848e745f4d24872d0b602426c718e70c376314 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 May 2025 18:02:33 -0700 Subject: [PATCH 15/41] Add active revisions mode param --- .github/workflows/run-validation.yml | 2 +- action.yml | 6 ++++++ azurecontainerapps.ts | 22 +++++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 191c4f5..5a8ce9a 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -50,7 +50,7 @@ jobs: containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - activeRevisionMode: 'Labels' + activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} # - name: Delete created Azure Container App diff --git a/action.yml b/action.yml index d1206b1..840f096 100644 --- a/action.yml +++ b/action.yml @@ -139,6 +139,12 @@ inputs: this GitHub Action.' required: false default: 'false' + activeRevisionsMode: + description: | + 'Possible options: Labels and Single. If set to "Labels", the action will use the targetLabel argument to + determine the label to apply to the Container App revision.' + required: false + default: 'Labels' targetLabel: description: | 'Specifies the target label for the Azure Container App revision. diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index b613af4..e086f42 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -106,6 +106,7 @@ export class azurecontainerapps { private static buildArguments: string; private static noIngressUpdate: boolean; private static useInternalRegistry: boolean; + private static activeRevisionsMode: string; private static targetLabel: string; /** @@ -178,6 +179,24 @@ export class azurecontainerapps { throw Error(conflictingArgumentsMessage); } + if(!this.util.isNullOrEmpty(this.activeRevisionsMode)) { + // Set the active revisions mode to use for the Container App, if provided + this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); + if (this.activeRevisionsMode !== 'Labels' && this.activeRevisionsMode !== 'Single') { + const invalidActiveRevisionsModeMessage = `The 'activeRevisionsMode' argument must be either 'Labels' or 'Single'.`; + this.toolHelper.writeError(invalidActiveRevisionsModeMessage); + throw Error(invalidActiveRevisionsModeMessage); + } + if (this.activeRevisionsMode === 'Labels') { + if (this.util.isNullOrEmpty(this.targetLabel)) { + const missingTargetLabelMessage = `The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'.`; + this.toolHelper.writeError(missingTargetLabelMessage); + throw Error(missingTargetLabelMessage); + } + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + } + } + // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' @@ -224,9 +243,6 @@ export class azurecontainerapps { // Get the resource group to deploy to if it was provided, or generate it from the Container App name this.resourceGroup = await this.getOrCreateResourceGroup(this.containerAppName, this.location); - // Get the target label to use for the Container App, if provided - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - // Determine if the Container Appp currently exists this.containerAppExists = await this.appHelper.doesContainerAppExist(this.containerAppName, this.resourceGroup); From 5d130232e81ef26adc33c605696bdb5c18d87466 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 10:38:36 -0700 Subject: [PATCH 16/41] Remove oidc workflow --- .github/workflows/run-validation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 5a8ce9a..0c75ab8 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -104,6 +104,7 @@ jobs: containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} - name: Delete created Azure Container App From 4e933df27be189f02dbd40eeae10e4113170c751 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 10:57:20 -0700 Subject: [PATCH 17/41] Add test log --- src/ContainerAppHelper.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index 3124083..50f51ab 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -95,6 +95,7 @@ export class ContainerAppHelper { containerAppName: string, resourceGroup: string, yamlConfigPath: string) { + toolHelper.writeInfo(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}" from provided YAML "${yamlConfigPath}"`); toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}" from provided YAML "${yamlConfigPath}"`); try { let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --yaml ${yamlConfigPath} --output none`; From 82cd02f2fe395db6248d591ebc540b553e8fac18 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 11:04:22 -0700 Subject: [PATCH 18/41] Add target labels params --- azurecontainerapps.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index e086f42..6aecb32 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -624,6 +624,14 @@ export class azurecontainerapps { this.commandLineArgs.push(`--ingress ${this.ingress}`); this.commandLineArgs.push(`--target-port ${this.targetPort}`); } + + // Handle TargetLabel setup when activeRevisionsMode is Labels + if (!this.util.isNullOrEmpty(this.targetLabel)) { + // If the target label is provided, add it to the command line arguments + this.commandLineArgs.push(`--revisions-mode Labels`); + this.commandLineArgs.push(`--target-label ${this.targetLabel}`); + + } } const environmentVariables: string = this.toolHelper.getInput('environmentVariables', false); From 61242a59293072a3f9750c913070d15727d43504 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 11:05:15 -0700 Subject: [PATCH 19/41] Remove oidc workflow --- .github/workflows/run-validation-oidc.yml | 679 ---------------------- 1 file changed, 679 deletions(-) delete mode 100644 .github/workflows/run-validation-oidc.yml diff --git a/.github/workflows/run-validation-oidc.yml b/.github/workflows/run-validation-oidc.yml deleted file mode 100644 index cb4151a..0000000 --- a/.github/workflows/run-validation-oidc.yml +++ /dev/null @@ -1,679 +0,0 @@ -name: Run validation on action using OIDC - -on: - push: - branches: - - main - paths-ignore: - - '**.md' - pull_request: - branches: - - main - paths-ignore: - - '**.md' - -env: - TEST_FULL_ACR_NAME: ${{ vars.TEST_ACR_NAME }}.azurecr.io - TEST_IMAGE_REPOSITORY: github-actions/container-app - -jobs: - create-using-builder: - - name: 'Create app using builder' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - - create-using-builder-and-internal-registry: - - name: 'Create app using builder and push to internal registry' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.OIDC_TEST_CLIENT_ID }} - tenant-id: ${{ secrets.OIDC_TEST_TENANT_ID }} - subscription-id: ${{ secrets.OIDC_TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -y - - - create-using-found-dockerfile: - - name: 'Create app using found Dockerfile' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - create-using-provided-dockerfile: - - name: 'Create app using provided Dockerfile' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' - dockerfilePath: 'Dockerfile' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - - create-using-image-linux: - - name: 'Create app using image on Linux runner' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-is-lin-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - create-using-image-windows: - - name: 'Create app using image on Windows runner' - runs-on: windows-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-is-win-${{ github.run_id }}' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - create-using-image-new-env: - - name: 'Create app using image with new environment' - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the OIDC JWT Token - timeout-minutes: 25 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' - TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Get customer ID for workspace to delete - if: ${{ always() }} - shell: bash - run: | - CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId') - echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV - - - name: Get name of workspace to delete - if: ${{ always() }} - shell: bash - run: | - WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]') - echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV - - - name: Delete created Azure Container App environment - if: ${{ always() }} - shell: bash - run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y - - - name: Delete created workspace - if: ${{ always() }} - shell: bash - run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y - - create-using-builder-yaml: - - name: 'Create app using builder with YAML configuration' - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-yaml-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-${{ github.run_id }}' - TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Update values in YAML configuration file - shell: pwsh - run: | - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$FULL_ACR_NAME$', '${{ env.TEST_FULL_ACR_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_USERNAME$', '${{ secrets.TEST_REGISTRY_USERNAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_PASSWORD$', '${{ secrets.TEST_REGISTRY_PASSWORD }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_REPOSITORY$', '${{ env.TEST_IMAGE_REPOSITORY }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_TAG$', '${{ env.TEST_IMAGE_TAG }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - create-using-image-yaml-linux: - - name: 'Create app using image with YAML configuration on Linux runner' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-lin-${{ github.run_id }}' - TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-image-simple.yaml' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Update values in YAML configuration file - shell: pwsh - run: | - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - create-using-image-yaml-windows: - - name: 'Create app using image with YAML configuration on Windows runner' - runs-on: windows-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-win-${{ github.run_id }}' - TEST_YAML_FILE_PATH: 'yaml-samples/create-with-image-simple.yaml' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Update values in YAML configuration file - shell: pwsh - run: | - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete created Azure Container App - if: ${{ always() }} - shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y - - update-using-builder: - - name: 'Update existing app using builder' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'update-using-builder-app' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - acrName: ${{ vars.TEST_ACR_NAME }} - acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} - acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Delete pushed image - if: ${{ always() }} - shell: bash - run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y - - - name: Update Container App with existing image - if: ${{ always() }} - shell: bash - run: az containerapp update -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -i mcr.microsoft.com/azuredocs/containerapps-helloworld:latest - - update-using-builder-and-internal-registry: - - name: 'Update existing app using builder and push to internal registry' - runs-on: ubuntu-latest - permissions: - id-token: write #This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' - TEST_CONTAINER_APP_NAME: 'update-using-builder-app' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Clone Oryx repository - uses: actions/checkout@v3 - with: - repository: microsoft/Oryx - path: oryx - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.OIDC_TEST_CLIENT_ID }} - tenant-id: ${{ secrets.OIDC_TEST_TENANT_ID }} - subscription-id: ${{ secrets.OIDC_TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' - containerAppName: ${{ vars.TEST_EXISTING_CONTAINER_APP }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - - name: Update Container App with existing image - if: ${{ always() }} - shell: bash - run: az containerapp update -n ${{ vars.TEST_EXISTING_CONTAINER_APP }} -g ${{ vars.TEST_RESOURCE_GROUP_NO_ACR_NAME }} -i mcr.microsoft.com/azuredocs/containerapps-helloworld:latest - - update-using-image: - - name: 'Update app using image' - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'update-using-image-app' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - update-using-image-yaml: - - name: 'Update app using image with YAML configuration' - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for requesting the OIDC JWT Token - timeout-minutes: 10 - - env: - TEST_CONTAINER_APP_NAME: 'update-using-image-yaml-app' - TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/update-with-image-simple.yaml' - - steps: - - name: Checkout action repository - uses: actions/checkout@v3 - - - name: Azure Login - uses: azure/login@v1 - with: - client-id: ${{ secrets.TEST_CLIENT_ID }} - tenant-id: ${{ secrets.TEST_TENANT_ID }} - subscription-id: ${{ secrets.TEST_SUBSCRIPTION_ID }} - - - name: Update values in YAML configuration file - shell: pwsh - run: | - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - (Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} - - - name: Execute Azure Container Apps Build and Deploy Action - uses: ./ - with: - yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} - containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} - resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} - disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} \ No newline at end of file From 93275dc910e4072fd207ede250358d6e30e7b317 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 11:10:07 -0700 Subject: [PATCH 20/41] Update target label params --- azurecontainerapps.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 6aecb32..b7f46bc 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -565,6 +565,7 @@ export class azurecontainerapps { * file is not provided. */ private static setupContainerAppProperties() { + this.toolHelper.writeInfo(`Setting up Container App properties...`); this.commandLineArgs = []; // Get the ingress inputs @@ -587,9 +588,13 @@ export class azurecontainerapps { `--registry-password ${this.registryPassword}`); } - // Add TargetLabel to the command-line arguments if provided + + // Handle TargetLabel setup when activeRevisionsMode is Labels if (!this.util.isNullOrEmpty(this.targetLabel)) { - this.commandLineArgs.push(`--targetLabel ${this.targetLabel}`); + // If the target label is provided, add it to the command line arguments + this.commandLineArgs.push(`--revisions-mode Labels`); + this.commandLineArgs.push(`--target-label ${this.targetLabel}`); + } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario @@ -624,14 +629,6 @@ export class azurecontainerapps { this.commandLineArgs.push(`--ingress ${this.ingress}`); this.commandLineArgs.push(`--target-port ${this.targetPort}`); } - - // Handle TargetLabel setup when activeRevisionsMode is Labels - if (!this.util.isNullOrEmpty(this.targetLabel)) { - // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push(`--revisions-mode Labels`); - this.commandLineArgs.push(`--target-label ${this.targetLabel}`); - - } } const environmentVariables: string = this.toolHelper.getInput('environmentVariables', false); From 653424c4134396e88bcdce0f64d041ed6a1bc594 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 11:38:18 -0700 Subject: [PATCH 21/41] Update logs --- azurecontainerapps.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index b7f46bc..35fe22a 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -662,11 +662,14 @@ export class azurecontainerapps { * Creates or updates the Container App. */ private static async createOrUpdateContainerApp() { + this.toolHelper.writeInfo(`Creating or updating Container App "${this.containerAppName}" in resource group "${this.resourceGroup}"...`); if (!this.containerAppExists) { if (!this.util.isNullOrEmpty(this.yamlConfigPath)) { + this.toolHelper.writeInfo(`Creating Container App "${this.containerAppName}" from YAML configuration file "${this.yamlConfigPath}"...`); // Create the Container App from the YAML configuration file await this.appHelper.createContainerAppFromYaml(this.containerAppName, this.resourceGroup, this.yamlConfigPath); } else { + this.toolHelper.writeInfo(`Creating Container App "${this.containerAppName}" from command line arguments...`); // Create the Container App from command line arguments await this.appHelper.createContainerApp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs); } From e0488173347f0d67d8cc461e3ee1cd8306dc60a2 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 12:31:49 -0700 Subject: [PATCH 22/41] Update param --- azurecontainerapps.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 35fe22a..398e33f 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -179,6 +179,7 @@ export class azurecontainerapps { throw Error(conflictingArgumentsMessage); } + this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode if(!this.util.isNullOrEmpty(this.activeRevisionsMode)) { // Set the active revisions mode to use for the Container App, if provided this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); From 72d174c452430cfe601090e84ab1bca25eb9457d Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 12:39:00 -0700 Subject: [PATCH 23/41] Update logs --- azurecontainerapps.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 398e33f..7809032 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -179,22 +179,33 @@ export class azurecontainerapps { throw Error(conflictingArgumentsMessage); } + this.toolHelper.writeDebug("Setting default value for activeRevisionsMode: 'Labels'"); this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode - if(!this.util.isNullOrEmpty(this.activeRevisionsMode)) { + + if (!this.util.isNullOrEmpty(this.activeRevisionsMode)) { + this.toolHelper.writeDebug("activeRevisionsMode is not null or empty, attempting to get input..."); + // Set the active revisions mode to use for the Container App, if provided this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); + this.toolHelper.writeDebug(`Retrieved activeRevisionsMode input: ${this.activeRevisionsMode}`); + if (this.activeRevisionsMode !== 'Labels' && this.activeRevisionsMode !== 'Single') { const invalidActiveRevisionsModeMessage = `The 'activeRevisionsMode' argument must be either 'Labels' or 'Single'.`; this.toolHelper.writeError(invalidActiveRevisionsModeMessage); throw Error(invalidActiveRevisionsModeMessage); } + if (this.activeRevisionsMode === 'Labels') { + this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); + if (this.util.isNullOrEmpty(this.targetLabel)) { const missingTargetLabelMessage = `The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'.`; this.toolHelper.writeError(missingTargetLabelMessage); throw Error(missingTargetLabelMessage); } + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + this.toolHelper.writeDebug(`Retrieved targetLabel input: ${this.targetLabel}`); } } From d96661978333fd812a28b31b0e73acb093d35c56 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 14:57:52 -0700 Subject: [PATCH 24/41] Update logs --- azurecontainerapps.ts | 8 ++++++-- src/ContainerAppHelper.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 7809032..c810dd5 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -207,7 +207,7 @@ export class azurecontainerapps { this.targetLabel = this.toolHelper.getInput('targetLabel', false); this.toolHelper.writeDebug(`Retrieved targetLabel input: ${this.targetLabel}`); } - } + } // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { @@ -603,10 +603,14 @@ export class azurecontainerapps { // Handle TargetLabel setup when activeRevisionsMode is Labels if (!this.util.isNullOrEmpty(this.targetLabel)) { + this.toolHelper.writeInfo('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); + // If the target label is provided, add it to the command line arguments this.commandLineArgs.push(`--revisions-mode Labels`); - this.commandLineArgs.push(`--target-label ${this.targetLabel}`); + this.toolHelper.writeInfo('Added "--revisions-mode Labels" to command line arguments.'); + this.commandLineArgs.push(`--target-label ${this.targetLabel}`); + this.toolHelper.writeInfo(`Added "--target-label ${this.targetLabel}" to command line arguments.`); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index 50f51ab..bba4bed 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -32,19 +32,27 @@ export class ContainerAppHelper { resourceGroup: string, environment: string, optionalCmdArgs: string[]) { + toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}"`); try { let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none`; + + toolHelper.writeInfo(`Base command initialized: ${command}`); + optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; }); + + toolHelper.writeInfo(`Final command with optional arguments: ${command}`); + await util.execute(command); + toolHelper.writeInfo(`Container App "${containerAppName}" created successfully.`); } catch (err) { - toolHelper.writeError(err.message); + toolHelper.writeError(`Error occurred while creating Container App "${containerAppName}": ${err.message}`); throw err; } } - + /** * Creates an Azure Container App. * @param containerAppName - the name of the Container App From 64608b1f1f0ad8cc1688cb5894d776a804c77f1b Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 16:02:31 -0700 Subject: [PATCH 25/41] Update index.js --- dist/index.js | 369 ++++++++++++++++++++++++------------------- package-lock.json | 392 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 4 +- 3 files changed, 594 insertions(+), 171 deletions(-) diff --git a/dist/index.js b/dist/index.js index bf431ad..05e3254 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 3238: +/***/ 4024: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -16,8 +16,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -44,13 +44,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.azurecontainerapps = void 0; -var fs = __nccwpck_require__(7147); -var path = __nccwpck_require__(1017); -var ContainerAppHelper_1 = __nccwpck_require__(2929); -var ContainerRegistryHelper_1 = __nccwpck_require__(4769); -var TelemetryHelper_1 = __nccwpck_require__(7166); -var Utility_1 = __nccwpck_require__(2135); -var GitHubActionsToolHelper_1 = __nccwpck_require__(3185); +var fs = __nccwpck_require__(9896); +var path = __nccwpck_require__(6928); +var ContainerAppHelper_1 = __nccwpck_require__(3135); +var ContainerRegistryHelper_1 = __nccwpck_require__(3745); +var TelemetryHelper_1 = __nccwpck_require__(7546); +var Utility_1 = __nccwpck_require__(6393); +var GitHubActionsToolHelper_1 = __nccwpck_require__(1569); var buildArgumentRegex = /"[^"]*"|\S+/g; var buildpackEnvironmentNameRegex = /^"?(BP|ORYX)_[-._a-zA-Z0-9]+"?$/; var azurecontainerapps = /** @class */ (function () { @@ -184,6 +184,29 @@ var azurecontainerapps = /** @class */ (function () { this.toolHelper.writeError(conflictingArgumentsMessage); throw Error(conflictingArgumentsMessage); } + this.toolHelper.writeDebug("Setting default value for activeRevisionsMode: 'Labels'"); + this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode + if (!this.util.isNullOrEmpty(this.activeRevisionsMode)) { + this.toolHelper.writeDebug("activeRevisionsMode is not null or empty, attempting to get input..."); + // Set the active revisions mode to use for the Container App, if provided + this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); + this.toolHelper.writeDebug("Retrieved activeRevisionsMode input: ".concat(this.activeRevisionsMode)); + if (this.activeRevisionsMode !== 'Labels' && this.activeRevisionsMode !== 'Single') { + var invalidActiveRevisionsModeMessage = "The 'activeRevisionsMode' argument must be either 'Labels' or 'Single'."; + this.toolHelper.writeError(invalidActiveRevisionsModeMessage); + throw Error(invalidActiveRevisionsModeMessage); + } + if (this.activeRevisionsMode === 'Labels') { + this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); + if (this.util.isNullOrEmpty(this.targetLabel)) { + var missingTargetLabelMessage = "The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'."; + this.toolHelper.writeError(missingTargetLabelMessage); + throw Error(missingTargetLabelMessage); + } + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + this.toolHelper.writeDebug("Retrieved targetLabel input: ".concat(this.targetLabel)); + } + } // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' @@ -644,6 +667,7 @@ var azurecontainerapps = /** @class */ (function () { * file is not provided. */ azurecontainerapps.setupContainerAppProperties = function () { + this.toolHelper.writeInfo("Setting up Container App properties..."); this.commandLineArgs = []; // Get the ingress inputs this.ingress = this.toolHelper.getInput('ingress', false); @@ -659,6 +683,15 @@ var azurecontainerapps = /** @class */ (function () { this.adminCredentialsProvided = true; this.commandLineArgs.push("--registry-server ".concat(this.registryUrl), "--registry-username ".concat(this.registryUsername), "--registry-password ".concat(this.registryPassword)); } + // Handle TargetLabel setup when activeRevisionsMode is Labels + if (!this.util.isNullOrEmpty(this.targetLabel)) { + this.toolHelper.writeInfo('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); + // If the target label is provided, add it to the command line arguments + this.commandLineArgs.push("--revisions-mode Labels"); + this.toolHelper.writeInfo('Added "--revisions-mode Labels" to command line arguments.'); + this.commandLineArgs.push("--target-label ".concat(this.targetLabel)); + this.toolHelper.writeInfo("Added \"--target-label ".concat(this.targetLabel, "\" to command line arguments.")); + } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario if (!this.containerAppExists) { this.ingressEnabled = true; @@ -707,6 +740,11 @@ var azurecontainerapps = /** @class */ (function () { else if (!this.util.isNullOrEmpty(this.appSourcePath) && this.useInternalRegistry) { this.commandLineArgs.push("--source ".concat(this.appSourcePath)); } + else if (!this.util.isNullOrEmpty(this.targetLabel)) { + // If the target label is provided, add it to the command line arguments + this.commandLineArgs.push("--revisions-mode Labels"); + this.commandLineArgs.push("--target-label ".concat(this.targetLabel)); + } }; /** * Creates or updates the Container App. @@ -716,17 +754,20 @@ var azurecontainerapps = /** @class */ (function () { return __generator(this, function (_a) { switch (_a.label) { case 0: + this.toolHelper.writeInfo("Creating or updating Container App \"".concat(this.containerAppName, "\" in resource group \"").concat(this.resourceGroup, "\"...")); if (!!this.containerAppExists) return [3 /*break*/, 5]; if (!!this.util.isNullOrEmpty(this.yamlConfigPath)) return [3 /*break*/, 2]; + this.toolHelper.writeInfo("Creating Container App \"".concat(this.containerAppName, "\" from YAML configuration file \"").concat(this.yamlConfigPath, "\"...")); // Create the Container App from the YAML configuration file return [4 /*yield*/, this.appHelper.createContainerAppFromYaml(this.containerAppName, this.resourceGroup, this.yamlConfigPath)]; case 1: // Create the Container App from the YAML configuration file _a.sent(); return [3 /*break*/, 4]; - case 2: - // Create the Container App from command line arguments - return [4 /*yield*/, this.appHelper.createContainerApp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs)]; + case 2: + this.toolHelper.writeInfo("Creating Container App \"".concat(this.containerAppName, "\" from command line arguments...")); + // Create the Container App from command line arguments + return [4 /*yield*/, this.appHelper.createContainerApp(this.containerAppName, this.resourceGroup, this.containerAppEnvironment, this.commandLineArgs)]; case 3: // Create the Container App from command line arguments _a.sent(); @@ -791,7 +832,7 @@ azurecontainerapps.runMain(); /***/ }), -/***/ 5688: +/***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -817,8 +858,8 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(2037)); -const utils_1 = __nccwpck_require__(869); +const os = __importStar(__nccwpck_require__(857)); +const utils_1 = __nccwpck_require__(302); /** * Commands * @@ -890,7 +931,7 @@ function escapeProperty(s) { /***/ }), -/***/ 3195: +/***/ 7484: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -925,12 +966,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(5688); -const file_command_1 = __nccwpck_require__(3930); -const utils_1 = __nccwpck_require__(869); -const os = __importStar(__nccwpck_require__(2037)); -const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(1755); +const command_1 = __nccwpck_require__(4914); +const file_command_1 = __nccwpck_require__(4753); +const utils_1 = __nccwpck_require__(302); +const os = __importStar(__nccwpck_require__(857)); +const path = __importStar(__nccwpck_require__(6928)); +const oidc_utils_1 = __nccwpck_require__(5306); /** * The code to exit an action */ @@ -1215,17 +1256,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(8606); +var summary_1 = __nccwpck_require__(1847); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(8606); +var summary_2 = __nccwpck_require__(1847); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(397); +var path_utils_1 = __nccwpck_require__(1976); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -1233,7 +1274,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 3930: +/***/ 4753: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1262,10 +1303,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(7147)); -const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(5814); -const utils_1 = __nccwpck_require__(869); +const fs = __importStar(__nccwpck_require__(9896)); +const os = __importStar(__nccwpck_require__(857)); +const uuid_1 = __nccwpck_require__(2048); +const utils_1 = __nccwpck_require__(302); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -1298,7 +1339,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 1755: +/***/ 5306: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1314,9 +1355,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(9780); -const auth_1 = __nccwpck_require__(8833); -const core_1 = __nccwpck_require__(3195); +const http_client_1 = __nccwpck_require__(4844); +const auth_1 = __nccwpck_require__(4552); +const core_1 = __nccwpck_require__(7484); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -1382,7 +1423,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 397: +/***/ 1976: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1408,7 +1449,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(1017)); +const path = __importStar(__nccwpck_require__(6928)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -1447,7 +1488,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 8606: +/***/ 1847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1463,8 +1504,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; -const os_1 = __nccwpck_require__(2037); -const fs_1 = __nccwpck_require__(7147); +const os_1 = __nccwpck_require__(857); +const fs_1 = __nccwpck_require__(9896); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -1737,7 +1778,7 @@ exports.summary = _summary; /***/ }), -/***/ 869: +/***/ 302: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1784,7 +1825,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 9714: +/***/ 5236: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1819,8 +1860,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(1576); -const tr = __importStar(__nccwpck_require__(5315)); +const string_decoder_1 = __nccwpck_require__(3193); +const tr = __importStar(__nccwpck_require__(6665)); /** * Exec a command. * Output will be streamed to the live console. @@ -1894,7 +1935,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 5315: +/***/ 6665: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1929,13 +1970,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.argStringToArray = exports.ToolRunner = void 0; -const os = __importStar(__nccwpck_require__(2037)); -const events = __importStar(__nccwpck_require__(2361)); -const child = __importStar(__nccwpck_require__(2081)); -const path = __importStar(__nccwpck_require__(1017)); -const io = __importStar(__nccwpck_require__(9529)); -const ioUtil = __importStar(__nccwpck_require__(7821)); -const timers_1 = __nccwpck_require__(9512); +const os = __importStar(__nccwpck_require__(857)); +const events = __importStar(__nccwpck_require__(4434)); +const child = __importStar(__nccwpck_require__(5317)); +const path = __importStar(__nccwpck_require__(6928)); +const io = __importStar(__nccwpck_require__(4994)); +const ioUtil = __importStar(__nccwpck_require__(5207)); +const timers_1 = __nccwpck_require__(3557); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* @@ -2519,7 +2560,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 8833: +/***/ 4552: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2607,7 +2648,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 9780: +/***/ 4844: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2643,10 +2684,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(3685)); -const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(4492)); -const tunnel = __importStar(__nccwpck_require__(9041)); +const http = __importStar(__nccwpck_require__(8611)); +const https = __importStar(__nccwpck_require__(5692)); +const pm = __importStar(__nccwpck_require__(4988)); +const tunnel = __importStar(__nccwpck_require__(770)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -3232,7 +3273,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 4492: +/***/ 4988: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3321,7 +3362,7 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 7821: +/***/ 5207: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3357,8 +3398,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; -const fs = __importStar(__nccwpck_require__(7147)); -const path = __importStar(__nccwpck_require__(1017)); +const fs = __importStar(__nccwpck_require__(9896)); +const path = __importStar(__nccwpck_require__(6928)); _a = fs.promises // export const {open} = 'fs' , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; @@ -3511,7 +3552,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 9529: +/***/ 4994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3546,9 +3587,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; -const assert_1 = __nccwpck_require__(9491); -const path = __importStar(__nccwpck_require__(1017)); -const ioUtil = __importStar(__nccwpck_require__(7821)); +const assert_1 = __nccwpck_require__(2613); +const path = __importStar(__nccwpck_require__(6928)); +const ioUtil = __importStar(__nccwpck_require__(5207)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -3817,27 +3858,27 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 9041: +/***/ 770: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(7111); +module.exports = __nccwpck_require__(218); /***/ }), -/***/ 7111: +/***/ 218: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var net = __nccwpck_require__(1808); -var tls = __nccwpck_require__(4404); -var http = __nccwpck_require__(3685); -var https = __nccwpck_require__(5687); -var events = __nccwpck_require__(2361); -var assert = __nccwpck_require__(9491); -var util = __nccwpck_require__(3837); +var net = __nccwpck_require__(9278); +var tls = __nccwpck_require__(4756); +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var events = __nccwpck_require__(4434); +var assert = __nccwpck_require__(2613); +var util = __nccwpck_require__(9023); exports.httpOverHttp = httpOverHttp; @@ -4097,7 +4138,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 5814: +/***/ 2048: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4161,29 +4202,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(6471)); +var _v = _interopRequireDefault(__nccwpck_require__(6415)); -var _v2 = _interopRequireDefault(__nccwpck_require__(3384)); +var _v2 = _interopRequireDefault(__nccwpck_require__(1697)); -var _v3 = _interopRequireDefault(__nccwpck_require__(5940)); +var _v3 = _interopRequireDefault(__nccwpck_require__(4676)); -var _v4 = _interopRequireDefault(__nccwpck_require__(9193)); +var _v4 = _interopRequireDefault(__nccwpck_require__(9771)); -var _nil = _interopRequireDefault(__nccwpck_require__(8654)); +var _nil = _interopRequireDefault(__nccwpck_require__(7723)); -var _version = _interopRequireDefault(__nccwpck_require__(2362)); +var _version = _interopRequireDefault(__nccwpck_require__(5868)); -var _validate = _interopRequireDefault(__nccwpck_require__(9815)); +var _validate = _interopRequireDefault(__nccwpck_require__(6200)); -var _stringify = _interopRequireDefault(__nccwpck_require__(5183)); +var _stringify = _interopRequireDefault(__nccwpck_require__(7597)); -var _parse = _interopRequireDefault(__nccwpck_require__(5108)); +var _parse = _interopRequireDefault(__nccwpck_require__(7267)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 9313: +/***/ 216: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4194,7 +4235,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +var _crypto = _interopRequireDefault(__nccwpck_require__(6982)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4213,7 +4254,7 @@ exports["default"] = _default; /***/ }), -/***/ 8654: +/***/ 7723: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4228,7 +4269,7 @@ exports["default"] = _default; /***/ }), -/***/ 5108: +/***/ 7267: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4239,7 +4280,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(9815)); +var _validate = _interopRequireDefault(__nccwpck_require__(6200)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4280,7 +4321,7 @@ exports["default"] = _default; /***/ }), -/***/ 1629: +/***/ 7879: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -4295,7 +4336,7 @@ exports["default"] = _default; /***/ }), -/***/ 9271: +/***/ 2973: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4306,7 +4347,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = rng; -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +var _crypto = _interopRequireDefault(__nccwpck_require__(6982)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4326,7 +4367,7 @@ function rng() { /***/ }), -/***/ 2017: +/***/ 507: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4337,7 +4378,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); +var _crypto = _interopRequireDefault(__nccwpck_require__(6982)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4356,7 +4397,7 @@ exports["default"] = _default; /***/ }), -/***/ 5183: +/***/ 7597: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4367,7 +4408,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(9815)); +var _validate = _interopRequireDefault(__nccwpck_require__(6200)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4402,7 +4443,7 @@ exports["default"] = _default; /***/ }), -/***/ 6471: +/***/ 6415: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4413,9 +4454,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(9271)); +var _rng = _interopRequireDefault(__nccwpck_require__(2973)); -var _stringify = _interopRequireDefault(__nccwpck_require__(5183)); +var _stringify = _interopRequireDefault(__nccwpck_require__(7597)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4516,7 +4557,7 @@ exports["default"] = _default; /***/ }), -/***/ 3384: +/***/ 1697: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4527,9 +4568,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(5717)); +var _v = _interopRequireDefault(__nccwpck_require__(2930)); -var _md = _interopRequireDefault(__nccwpck_require__(9313)); +var _md = _interopRequireDefault(__nccwpck_require__(216)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4539,7 +4580,7 @@ exports["default"] = _default; /***/ }), -/***/ 5717: +/***/ 2930: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4551,9 +4592,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(5183)); +var _stringify = _interopRequireDefault(__nccwpck_require__(7597)); -var _parse = _interopRequireDefault(__nccwpck_require__(5108)); +var _parse = _interopRequireDefault(__nccwpck_require__(7267)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4624,7 +4665,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 5940: +/***/ 4676: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4635,9 +4676,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(9271)); +var _rng = _interopRequireDefault(__nccwpck_require__(2973)); -var _stringify = _interopRequireDefault(__nccwpck_require__(5183)); +var _stringify = _interopRequireDefault(__nccwpck_require__(7597)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4668,7 +4709,7 @@ exports["default"] = _default; /***/ }), -/***/ 9193: +/***/ 9771: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4679,9 +4720,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(5717)); +var _v = _interopRequireDefault(__nccwpck_require__(2930)); -var _sha = _interopRequireDefault(__nccwpck_require__(2017)); +var _sha = _interopRequireDefault(__nccwpck_require__(507)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4691,7 +4732,7 @@ exports["default"] = _default; /***/ }), -/***/ 9815: +/***/ 6200: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4702,7 +4743,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(1629)); +var _regex = _interopRequireDefault(__nccwpck_require__(7879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4715,7 +4756,7 @@ exports["default"] = _default; /***/ }), -/***/ 2362: +/***/ 5868: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -4726,7 +4767,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(9815)); +var _validate = _interopRequireDefault(__nccwpck_require__(6200)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -4743,7 +4784,7 @@ exports["default"] = _default; /***/ }), -/***/ 2929: +/***/ 3135: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4758,8 +4799,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -4786,11 +4827,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContainerAppHelper = void 0; -var path = __nccwpck_require__(1017); -var os = __nccwpck_require__(2037); -var Utility_1 = __nccwpck_require__(2135); -var GitHubActionsToolHelper_1 = __nccwpck_require__(3185); -var fs = __nccwpck_require__(7147); +var path = __nccwpck_require__(6928); +var os = __nccwpck_require__(857); +var Utility_1 = __nccwpck_require__(6393); +var GitHubActionsToolHelper_1 = __nccwpck_require__(1569); +var fs = __nccwpck_require__(9896); var ORYX_CLI_IMAGE = 'mcr.microsoft.com/oryx/cli:builder-debian-bullseye-20230926.1'; var ORYX_BULLSEYE_BUILDER_IMAGE = 'mcr.microsoft.com/oryx/builder:debian-bullseye-20240124.1'; var ORYX_BOOKWORM_BUILDER_IMAGE = 'mcr.microsoft.com/oryx/builder:debian-bookworm-20240124.1'; @@ -4822,16 +4863,19 @@ var ContainerAppHelper = /** @class */ (function () { case 1: _a.trys.push([1, 3, , 4]); command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none"); + toolHelper.writeInfo("Base command initialized: ".concat(command_1)); optionalCmdArgs.forEach(function (val) { command_1 += " ".concat(val); }); + toolHelper.writeInfo("Final command with optional arguments: ".concat(command_1)); return [4 /*yield*/, util.execute(command_1)]; case 2: _a.sent(); + toolHelper.writeInfo("Container App \"".concat(containerAppName, "\" created successfully.")); return [3 /*break*/, 4]; case 3: err_1 = _a.sent(); - toolHelper.writeError(err_1.message); + toolHelper.writeError("Error occurred while creating Container App \"".concat(containerAppName, "\": ").concat(err_1.message)); throw err_1; case 4: return [2 /*return*/]; } @@ -4912,6 +4956,7 @@ var ContainerAppHelper = /** @class */ (function () { return __generator(this, function (_a) { switch (_a.label) { case 0: + toolHelper.writeInfo("Attempting to create Container App with name \"".concat(containerAppName, "\" in resource group \"").concat(resourceGroup, "\" from provided YAML \"").concat(yamlConfigPath, "\"")); toolHelper.writeDebug("Attempting to create Container App with name \"".concat(containerAppName, "\" in resource group \"").concat(resourceGroup, "\" from provided YAML \"").concat(yamlConfigPath, "\"")); _a.label = 1; case 1: @@ -5663,7 +5708,7 @@ exports.ContainerAppHelper = ContainerAppHelper; /***/ }), -/***/ 4769: +/***/ 3745: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5678,8 +5723,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -5706,9 +5751,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContainerRegistryHelper = void 0; -var os = __nccwpck_require__(2037); -var Utility_1 = __nccwpck_require__(2135); -var GitHubActionsToolHelper_1 = __nccwpck_require__(3185); +var os = __nccwpck_require__(857); +var Utility_1 = __nccwpck_require__(6393); +var GitHubActionsToolHelper_1 = __nccwpck_require__(1569); var toolHelper = new GitHubActionsToolHelper_1.GitHubActionsToolHelper(); var util = new Utility_1.Utility(); var ContainerRegistryHelper = /** @class */ (function () { @@ -5806,7 +5851,7 @@ exports.ContainerRegistryHelper = ContainerRegistryHelper; /***/ }), -/***/ 3185: +/***/ 1569: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5821,8 +5866,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -5849,9 +5894,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GitHubActionsToolHelper = void 0; -var core = __nccwpck_require__(3195); -var io = __nccwpck_require__(9529); -var exec = __nccwpck_require__(9714); +var core = __nccwpck_require__(7484); +var io = __nccwpck_require__(4994); +var exec = __nccwpck_require__(5236); var GitHubActionsToolHelper = /** @class */ (function () { function GitHubActionsToolHelper() { } @@ -5947,7 +5992,7 @@ exports.GitHubActionsToolHelper = GitHubActionsToolHelper; /***/ }), -/***/ 7166: +/***/ 7546: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5962,8 +6007,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -5990,8 +6035,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TelemetryHelper = void 0; -var Utility_1 = __nccwpck_require__(2135); -var GitHubActionsToolHelper_1 = __nccwpck_require__(3185); +var Utility_1 = __nccwpck_require__(6393); +var GitHubActionsToolHelper_1 = __nccwpck_require__(1569); var ORYX_CLI_IMAGE = "mcr.microsoft.com/oryx/cli:debian-buster-20230207.2"; var SUCCESSFUL_RESULT = "succeeded"; var FAILED_RESULT = "failed"; @@ -6084,7 +6129,7 @@ exports.TelemetryHelper = TelemetryHelper; /***/ }), -/***/ 2135: +/***/ 6393: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -6099,8 +6144,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); @@ -6128,7 +6173,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Utility = void 0; // Note: This file is used to define utility functions that can be used across the project. -var GitHubActionsToolHelper_1 = __nccwpck_require__(3185); +var GitHubActionsToolHelper_1 = __nccwpck_require__(1569); var toolHelper = new GitHubActionsToolHelper_1.GitHubActionsToolHelper(); var Utility = /** @class */ (function () { function Utility() { @@ -6178,7 +6223,7 @@ exports.Utility = Utility; /***/ }), -/***/ 9491: +/***/ 2613: /***/ ((module) => { "use strict"; @@ -6186,7 +6231,7 @@ module.exports = require("assert"); /***/ }), -/***/ 2081: +/***/ 5317: /***/ ((module) => { "use strict"; @@ -6194,7 +6239,7 @@ module.exports = require("child_process"); /***/ }), -/***/ 6113: +/***/ 6982: /***/ ((module) => { "use strict"; @@ -6202,7 +6247,7 @@ module.exports = require("crypto"); /***/ }), -/***/ 2361: +/***/ 4434: /***/ ((module) => { "use strict"; @@ -6210,7 +6255,7 @@ module.exports = require("events"); /***/ }), -/***/ 7147: +/***/ 9896: /***/ ((module) => { "use strict"; @@ -6218,7 +6263,7 @@ module.exports = require("fs"); /***/ }), -/***/ 3685: +/***/ 8611: /***/ ((module) => { "use strict"; @@ -6226,7 +6271,7 @@ module.exports = require("http"); /***/ }), -/***/ 5687: +/***/ 5692: /***/ ((module) => { "use strict"; @@ -6234,7 +6279,7 @@ module.exports = require("https"); /***/ }), -/***/ 1808: +/***/ 9278: /***/ ((module) => { "use strict"; @@ -6242,7 +6287,7 @@ module.exports = require("net"); /***/ }), -/***/ 2037: +/***/ 857: /***/ ((module) => { "use strict"; @@ -6250,7 +6295,7 @@ module.exports = require("os"); /***/ }), -/***/ 1017: +/***/ 6928: /***/ ((module) => { "use strict"; @@ -6258,7 +6303,7 @@ module.exports = require("path"); /***/ }), -/***/ 1576: +/***/ 3193: /***/ ((module) => { "use strict"; @@ -6266,7 +6311,7 @@ module.exports = require("string_decoder"); /***/ }), -/***/ 9512: +/***/ 3557: /***/ ((module) => { "use strict"; @@ -6274,7 +6319,7 @@ module.exports = require("timers"); /***/ }), -/***/ 4404: +/***/ 4756: /***/ ((module) => { "use strict"; @@ -6282,7 +6327,7 @@ module.exports = require("tls"); /***/ }), -/***/ 3837: +/***/ 9023: /***/ ((module) => { "use strict"; @@ -6332,7 +6377,7 @@ module.exports = require("util"); /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(3238); +/******/ var __webpack_exports__ = __nccwpck_require__(4024); /******/ module.exports = __webpack_exports__; /******/ /******/ })() diff --git a/package-lock.json b/package-lock.json index 32e7625..414b7c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,10 +12,12 @@ "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", "@actions/github": "^5.1.1", + "ncc": "^0.3.6", "typescript": "^5.2.2" }, "devDependencies": { - "@types/node": "^20.6.0" + "@types/node": "^20.17.57", + "@vercel/ncc": "^0.38.3" } }, "node_modules/@actions/core": { @@ -161,21 +163,119 @@ } }, "node_modules/@types/node": { - "version": "20.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", - "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==", - "dev": true + "version": "20.17.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.57.tgz", + "integrity": "sha512-f3T4y6VU4fVQDKVqJV4Uppy8c1p/sVvS3peyqxyWnzkqXFJLRU7Y1Bl7rMS1Qe9z0v4M6McY0Fp9yBsgHJUsWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@vercel/ncc": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", + "integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==", + "dev": true, + "license": "MIT", + "bin": { + "ncc": "dist/ncc/cli.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" }, "node_modules/before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/colors": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.3.tgz", + "integrity": "sha512-qTfM2pNFeMZcLvf/RbrVAzDEVttZjFhaApfx9dplNjvHSX88Ui66zBRb/4YGob/xUWxDceirgoC1lT676asfCQ==", + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -184,6 +284,51 @@ "node": ">=0.10.0" } }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ncc": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/ncc/-/ncc-0.3.6.tgz", + "integrity": "sha512-OXudTB2Ebt/FnOuDoPQbaa17+tdVqSOWA+gLfPxccWwsNED1uA2zEhpoB1hwdFC9yYbio/mdV5cvOtQI3Zrx1w==", + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "tracer": "^0.8.7", + "ws": "^2.3.1" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -211,11 +356,63 @@ "wrappy": "1" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha512-cr7dZWLwOeaFBLTIuZeYdkfO7UzGIKhjYENJFAxUOMKWGaWDm2nJM2rzxNRm5Owu0DH3ApwNo6kx5idXZfb/Iw==", + "license": "MIT" + }, + "node_modules/tinytim": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/tinytim/-/tinytim-0.1.1.tgz", + "integrity": "sha512-NIpsp9lBIxPNzB++HnMmUd4byzJSVbbO4F+As1Gb1IG/YQT5QvmBDjpx8SpDS8fhGC+t+Qw8ldQgbcAIaU+2cA==", + "license": "MIT", + "engines": { + "node": ">= 0.2.0" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/tracer": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/tracer/-/tracer-0.8.15.tgz", + "integrity": "sha512-ZQzlhd6zZFIpAhACiZkxLjl65XqVwi8t8UEBVGRIHAQN6nj55ftJWiFell+WSqWCP/vEycrIbUSuiyMwul+TFw==", + "license": "MIT", + "dependencies": { + "colors": "1.2.3", + "dateformat": "3.0.3", + "mkdirp": "^0.5.1", + "tinytim": "0.1.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -236,6 +433,19 @@ "node": ">=14.17" } }, + "node_modules/ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -267,6 +477,16 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", + "integrity": "sha512-61a+9LgtYZxTq1hAonhX8Xwpo2riK4IOR/BIVxioFbCfc3QFKmpE4x9dLExfLHKtUfVZigYa36tThVhO57erEw==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.0.1", + "ultron": "~1.1.0" + } } }, "dependencies": { @@ -407,26 +627,128 @@ } }, "@types/node": { - "version": "20.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", - "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==", + "version": "20.17.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.57.tgz", + "integrity": "sha512-f3T4y6VU4fVQDKVqJV4Uppy8c1p/sVvS3peyqxyWnzkqXFJLRU7Y1Bl7rMS1Qe9z0v4M6McY0Fp9yBsgHJUsWQ==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } + }, + "@vercel/ncc": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz", + "integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==", "dev": true }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "before-after-hook": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "colors": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.3.tgz", + "integrity": "sha512-qTfM2pNFeMZcLvf/RbrVAzDEVttZjFhaApfx9dplNjvHSX88Ui66zBRb/4YGob/xUWxDceirgoC1lT676asfCQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" + }, "deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "requires": { + "minimist": "^1.2.6" + } + }, + "ncc": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/ncc/-/ncc-0.3.6.tgz", + "integrity": "sha512-OXudTB2Ebt/FnOuDoPQbaa17+tdVqSOWA+gLfPxccWwsNED1uA2zEhpoB1hwdFC9yYbio/mdV5cvOtQI3Zrx1w==", + "requires": { + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "tracer": "^0.8.7", + "ws": "^2.3.1" + } + }, "node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -443,11 +765,45 @@ "wrappy": "1" } }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha512-cr7dZWLwOeaFBLTIuZeYdkfO7UzGIKhjYENJFAxUOMKWGaWDm2nJM2rzxNRm5Owu0DH3ApwNo6kx5idXZfb/Iw==" + }, + "tinytim": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/tinytim/-/tinytim-0.1.1.tgz", + "integrity": "sha512-NIpsp9lBIxPNzB++HnMmUd4byzJSVbbO4F+As1Gb1IG/YQT5QvmBDjpx8SpDS8fhGC+t+Qw8ldQgbcAIaU+2cA==" + }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "tracer": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/tracer/-/tracer-0.8.15.tgz", + "integrity": "sha512-ZQzlhd6zZFIpAhACiZkxLjl65XqVwi8t8UEBVGRIHAQN6nj55ftJWiFell+WSqWCP/vEycrIbUSuiyMwul+TFw==", + "requires": { + "colors": "1.2.3", + "dateformat": "3.0.3", + "mkdirp": "^0.5.1", + "tinytim": "0.1.1" + } + }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -458,6 +814,17 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" + }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -486,6 +853,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "ws": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", + "integrity": "sha512-61a+9LgtYZxTq1hAonhX8Xwpo2riK4IOR/BIVxioFbCfc3QFKmpE4x9dLExfLHKtUfVZigYa36tThVhO57erEw==", + "requires": { + "safe-buffer": "~5.0.1", + "ultron": "~1.1.0" + } } } } diff --git a/package.json b/package.json index 6b9c3dc..7af1360 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,11 @@ "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", "@actions/github": "^5.1.1", + "ncc": "^0.3.6", "typescript": "^5.2.2" }, "devDependencies": { - "@types/node": "^20.6.0" + "@types/node": "^20.17.57", + "@vercel/ncc": "^0.38.3" } } From 80aacac04fdcf29b9c0020d82107ea2e5c16b21a Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 16:38:16 -0700 Subject: [PATCH 26/41] Update index.js --- azurecontainerapps.ts | 7 +++---- dist/index.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index c810dd5..d9e1d60 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -181,7 +181,7 @@ export class azurecontainerapps { this.toolHelper.writeDebug("Setting default value for activeRevisionsMode: 'Labels'"); this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode - + if (!this.util.isNullOrEmpty(this.activeRevisionsMode)) { this.toolHelper.writeDebug("activeRevisionsMode is not null or empty, attempting to get input..."); @@ -198,14 +198,13 @@ export class azurecontainerapps { if (this.activeRevisionsMode === 'Labels') { this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + this.toolHelper.writeDebug(`Retrieved targetLabel input: ${this.targetLabel}`); if (this.util.isNullOrEmpty(this.targetLabel)) { const missingTargetLabelMessage = `The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'.`; this.toolHelper.writeError(missingTargetLabelMessage); throw Error(missingTargetLabelMessage); } - - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - this.toolHelper.writeDebug(`Retrieved targetLabel input: ${this.targetLabel}`); } } diff --git a/dist/index.js b/dist/index.js index 05e3254..df4758d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -198,13 +198,13 @@ var azurecontainerapps = /** @class */ (function () { } if (this.activeRevisionsMode === 'Labels') { this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + this.toolHelper.writeDebug("Retrieved targetLabel input: ".concat(this.targetLabel)); if (this.util.isNullOrEmpty(this.targetLabel)) { var missingTargetLabelMessage = "The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'."; this.toolHelper.writeError(missingTargetLabelMessage); throw Error(missingTargetLabelMessage); } - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - this.toolHelper.writeDebug("Retrieved targetLabel input: ".concat(this.targetLabel)); } } // Set up the build arguments to pass to the Dockerfile or builder From 83fdac719e1af0edd7dca0fa1bee0ba44979e3c1 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 17:10:30 -0700 Subject: [PATCH 27/41] Update index.js --- .github/workflows/run-validation.yml | 23 +++++++++++++++++---- action.yml | 6 ------ azurecontainerapps.ts | 30 ---------------------------- dist/index.js | 23 --------------------- 4 files changed, 19 insertions(+), 63 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 0c75ab8..a533b15 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -53,10 +53,15 @@ jobs: activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} - # - name: Delete created Azure Container App - # if: ${{ always() }} - # shell: bash - # run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + - name: Wait before deletion + if: ${{ always() }} + shell: bash + run: sleep 21 + + - name: Delete created Azure Container App + if: ${{ always() }} + shell: bash + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y create-using-image-yaml-linux: @@ -107,6 +112,11 @@ jobs: activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} + - name: Wait before deletion + if: ${{ always() }} + shell: bash + run: sleep 21 + - name: Delete created Azure Container App if: ${{ always() }} shell: bash @@ -158,6 +168,11 @@ jobs: resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + - name: Wait before deletion + if: ${{ always() }} + shell: bash + run: sleep 21 + - name: Delete created Azure Container App if: ${{ always() }} shell: bash diff --git a/action.yml b/action.yml index 840f096..d1206b1 100644 --- a/action.yml +++ b/action.yml @@ -139,12 +139,6 @@ inputs: this GitHub Action.' required: false default: 'false' - activeRevisionsMode: - description: | - 'Possible options: Labels and Single. If set to "Labels", the action will use the targetLabel argument to - determine the label to apply to the Container App revision.' - required: false - default: 'Labels' targetLabel: description: | 'Specifies the target label for the Azure Container App revision. diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index d9e1d60..2dd06b0 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -106,7 +106,6 @@ export class azurecontainerapps { private static buildArguments: string; private static noIngressUpdate: boolean; private static useInternalRegistry: boolean; - private static activeRevisionsMode: string; private static targetLabel: string; /** @@ -179,35 +178,6 @@ export class azurecontainerapps { throw Error(conflictingArgumentsMessage); } - this.toolHelper.writeDebug("Setting default value for activeRevisionsMode: 'Labels'"); - this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode - - if (!this.util.isNullOrEmpty(this.activeRevisionsMode)) { - this.toolHelper.writeDebug("activeRevisionsMode is not null or empty, attempting to get input..."); - - // Set the active revisions mode to use for the Container App, if provided - this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); - this.toolHelper.writeDebug(`Retrieved activeRevisionsMode input: ${this.activeRevisionsMode}`); - - if (this.activeRevisionsMode !== 'Labels' && this.activeRevisionsMode !== 'Single') { - const invalidActiveRevisionsModeMessage = `The 'activeRevisionsMode' argument must be either 'Labels' or 'Single'.`; - this.toolHelper.writeError(invalidActiveRevisionsModeMessage); - throw Error(invalidActiveRevisionsModeMessage); - } - - if (this.activeRevisionsMode === 'Labels') { - this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); - - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - this.toolHelper.writeDebug(`Retrieved targetLabel input: ${this.targetLabel}`); - if (this.util.isNullOrEmpty(this.targetLabel)) { - const missingTargetLabelMessage = `The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'.`; - this.toolHelper.writeError(missingTargetLabelMessage); - throw Error(missingTargetLabelMessage); - } - } - } - // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' diff --git a/dist/index.js b/dist/index.js index df4758d..16e18f4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -184,29 +184,6 @@ var azurecontainerapps = /** @class */ (function () { this.toolHelper.writeError(conflictingArgumentsMessage); throw Error(conflictingArgumentsMessage); } - this.toolHelper.writeDebug("Setting default value for activeRevisionsMode: 'Labels'"); - this.activeRevisionsMode = 'Labels'; // Default value for active revisions mode - if (!this.util.isNullOrEmpty(this.activeRevisionsMode)) { - this.toolHelper.writeDebug("activeRevisionsMode is not null or empty, attempting to get input..."); - // Set the active revisions mode to use for the Container App, if provided - this.activeRevisionsMode = this.toolHelper.getInput('activeRevisionsMode', false); - this.toolHelper.writeDebug("Retrieved activeRevisionsMode input: ".concat(this.activeRevisionsMode)); - if (this.activeRevisionsMode !== 'Labels' && this.activeRevisionsMode !== 'Single') { - var invalidActiveRevisionsModeMessage = "The 'activeRevisionsMode' argument must be either 'Labels' or 'Single'."; - this.toolHelper.writeError(invalidActiveRevisionsModeMessage); - throw Error(invalidActiveRevisionsModeMessage); - } - if (this.activeRevisionsMode === 'Labels') { - this.toolHelper.writeDebug("activeRevisionsMode is 'Labels'. Checking for targetLabel..."); - this.targetLabel = this.toolHelper.getInput('targetLabel', false); - this.toolHelper.writeDebug("Retrieved targetLabel input: ".concat(this.targetLabel)); - if (this.util.isNullOrEmpty(this.targetLabel)) { - var missingTargetLabelMessage = "The 'targetLabel' argument must be provided when 'activeRevisionsMode' is set to 'Labels'."; - this.toolHelper.writeError(missingTargetLabelMessage); - throw Error(missingTargetLabelMessage); - } - } - } // Set up the build arguments to pass to the Dockerfile or builder if (!this.util.isNullOrEmpty(this.buildArguments)) { // Ensure that the build arguments are in the format 'key1=value1 key2=value2' From 03c324f982fb3041480757a5e18783f6bb828ef7 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 17:36:36 -0700 Subject: [PATCH 28/41] Update workflow --- .github/workflows/run-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index a533b15..1947d3f 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -120,7 +120,7 @@ jobs: - name: Delete created Azure Container App if: ${{ always() }} shell: bash - run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} 'gh-action-test' -y + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y create-using-image-yaml-windows: From c772872c0fa9546b34730e6ba92464659cf550cf Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 17:41:47 -0700 Subject: [PATCH 29/41] Update workflow --- azurecontainerapps.ts | 6 +++--- dist/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 2dd06b0..0d7ce70 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -572,14 +572,14 @@ export class azurecontainerapps { // Handle TargetLabel setup when activeRevisionsMode is Labels if (!this.util.isNullOrEmpty(this.targetLabel)) { - this.toolHelper.writeInfo('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); + this.toolHelper.writeDebug('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); // If the target label is provided, add it to the command line arguments this.commandLineArgs.push(`--revisions-mode Labels`); - this.toolHelper.writeInfo('Added "--revisions-mode Labels" to command line arguments.'); + this.toolHelper.writeDebug('Added "--revisions-mode Labels" to command line arguments.'); this.commandLineArgs.push(`--target-label ${this.targetLabel}`); - this.toolHelper.writeInfo(`Added "--target-label ${this.targetLabel}" to command line arguments.`); + this.toolHelper.writeDebug(`Added "--target-label ${this.targetLabel}" to command line arguments.`); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario diff --git a/dist/index.js b/dist/index.js index 16e18f4..d7784f5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -662,12 +662,12 @@ var azurecontainerapps = /** @class */ (function () { } // Handle TargetLabel setup when activeRevisionsMode is Labels if (!this.util.isNullOrEmpty(this.targetLabel)) { - this.toolHelper.writeInfo('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); + this.toolHelper.writeDebug('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); // If the target label is provided, add it to the command line arguments this.commandLineArgs.push("--revisions-mode Labels"); - this.toolHelper.writeInfo('Added "--revisions-mode Labels" to command line arguments.'); + this.toolHelper.writeDebug('Added "--revisions-mode Labels" to command line arguments.'); this.commandLineArgs.push("--target-label ".concat(this.targetLabel)); - this.toolHelper.writeInfo("Added \"--target-label ".concat(this.targetLabel, "\" to command line arguments.")); + this.toolHelper.writeDebug("Added \"--target-label ".concat(this.targetLabel, "\" to command line arguments.")); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario if (!this.containerAppExists) { From aaf47d774198d6f2e3a31d781f858cae0140df79 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 17:49:39 -0700 Subject: [PATCH 30/41] Update comment --- .github/workflows/run-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 1947d3f..85b3c09 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - williamhe/add-labels-support + - williamhe/add-labels-support # test comment paths-ignore: - '**.md' pull_request: From 55d3499f104370245a40e6b950c97fedb0f228b4 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 May 2025 18:57:14 -0700 Subject: [PATCH 31/41] Update comment --- azurecontainerapps.ts | 2 ++ dist/index.js | 1 + 2 files changed, 3 insertions(+) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 0d7ce70..ad338c9 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -161,6 +161,8 @@ export class azurecontainerapps { // Get the name of the image to build if it was provided, or generate it from build variables this.imageToBuild = this.toolHelper.getInput('imageToBuild', false); + this.targetLabel = this.toolHelper.getInput('targetLabel', false); + // Get the user defined build arguments, if provided this.buildArguments = this.toolHelper.getInput('buildArguments', false); diff --git a/dist/index.js b/dist/index.js index d7784f5..3a63735 100644 --- a/dist/index.js +++ b/dist/index.js @@ -170,6 +170,7 @@ var azurecontainerapps = /** @class */ (function () { this.yamlConfigPath = this.toolHelper.getInput('yamlConfigPath', false); // Get the name of the image to build if it was provided, or generate it from build variables this.imageToBuild = this.toolHelper.getInput('imageToBuild', false); + this.targetLabel = this.toolHelper.getInput('targetLabel', false); // Get the user defined build arguments, if provided this.buildArguments = this.toolHelper.getInput('buildArguments', false); // Ensure that one of appSourcePath, imageToDeploy, or yamlConfigPath is provided From 7e5cc921f468b715a5b7faba404c6c191720da7a Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:00:45 -0700 Subject: [PATCH 32/41] Remove extra logs --- azurecontainerapps.ts | 4 ++-- src/ContainerAppHelper.ts | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index ad338c9..8ddf81c 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -162,7 +162,7 @@ export class azurecontainerapps { this.imageToBuild = this.toolHelper.getInput('imageToBuild', false); this.targetLabel = this.toolHelper.getInput('targetLabel', false); - + // Get the user defined build arguments, if provided this.buildArguments = this.toolHelper.getInput('buildArguments', false); @@ -548,7 +548,7 @@ export class azurecontainerapps { * file is not provided. */ private static setupContainerAppProperties() { - this.toolHelper.writeInfo(`Setting up Container App properties...`); + this.toolHelper.writeDebug(`Setting up Container App properties...`); this.commandLineArgs = []; // Get the ingress inputs diff --git a/src/ContainerAppHelper.ts b/src/ContainerAppHelper.ts index bba4bed..4085adc 100644 --- a/src/ContainerAppHelper.ts +++ b/src/ContainerAppHelper.ts @@ -36,23 +36,18 @@ export class ContainerAppHelper { toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}"`); try { let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --environment ${environment} --output none`; - - toolHelper.writeInfo(`Base command initialized: ${command}`); - + optionalCmdArgs.forEach(function (val: string) { command += ` ${val}`; }); - - toolHelper.writeInfo(`Final command with optional arguments: ${command}`); - + await util.execute(command); - toolHelper.writeInfo(`Container App "${containerAppName}" created successfully.`); } catch (err) { toolHelper.writeError(`Error occurred while creating Container App "${containerAppName}": ${err.message}`); throw err; } } - + /** * Creates an Azure Container App. * @param containerAppName - the name of the Container App @@ -103,7 +98,6 @@ export class ContainerAppHelper { containerAppName: string, resourceGroup: string, yamlConfigPath: string) { - toolHelper.writeInfo(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}" from provided YAML "${yamlConfigPath}"`); toolHelper.writeDebug(`Attempting to create Container App with name "${containerAppName}" in resource group "${resourceGroup}" from provided YAML "${yamlConfigPath}"`); try { let command = `az containerapp create -n ${containerAppName} -g ${resourceGroup} --yaml ${yamlConfigPath} --output none`; From fba7a6aa5b31b80d2d17aa03e8bfda4f0bbfc9ea Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:03:37 -0700 Subject: [PATCH 33/41] Remove test branch --- .github/workflows/run-validation.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 85b3c09..ed543f0 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - williamhe/add-labels-support # test comment paths-ignore: - '**.md' pull_request: From d58b88dc7986547c80bf5b0c864a62053f70fdfe Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:09:21 -0700 Subject: [PATCH 34/41] Remove unnecessary wait --- .github/workflows/run-validation.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index ed543f0..033857f 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -52,11 +52,6 @@ jobs: activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} - - name: Wait before deletion - if: ${{ always() }} - shell: bash - run: sleep 21 - - name: Delete created Azure Container App if: ${{ always() }} shell: bash @@ -111,11 +106,6 @@ jobs: activeRevisionsMode: 'Labels' targetLabel: ${{ vars.TEST_TARGET_LABEL }} - - name: Wait before deletion - if: ${{ always() }} - shell: bash - run: sleep 21 - - name: Delete created Azure Container App if: ${{ always() }} shell: bash @@ -167,11 +157,6 @@ jobs: resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} - - name: Wait before deletion - if: ${{ always() }} - shell: bash - run: sleep 21 - - name: Delete created Azure Container App if: ${{ always() }} shell: bash From f80059961eba4c76a9d1f7657e4eb0c61c8677b3 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:20:58 -0700 Subject: [PATCH 35/41] Update with code review suggesstions --- azurecontainerapps.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 8ddf81c..4da76c3 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -577,11 +577,8 @@ export class azurecontainerapps { this.toolHelper.writeDebug('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push(`--revisions-mode Labels`); - this.toolHelper.writeDebug('Added "--revisions-mode Labels" to command line arguments.'); - - this.commandLineArgs.push(`--target-label ${this.targetLabel}`); - this.toolHelper.writeDebug(`Added "--target-label ${this.targetLabel}" to command line arguments.`); + this.commandLineArgs.push(`--revisions-mode Labels`, `--target-label ${this.targetLabel}`); + this.toolHelper.writeDebug('Added "--revisions-mode Labels" and "--target-label ${this.targetLabel}" to command line arguments.'); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario @@ -638,9 +635,7 @@ export class azurecontainerapps { this.commandLineArgs.push(`--source ${this.appSourcePath}`); } else if (!this.util.isNullOrEmpty(this.targetLabel)) { // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push(`--revisions-mode Labels`); - this.commandLineArgs.push(`--target-label ${this.targetLabel}`); - + this.commandLineArgs.push(`--revisions-mode Labels`, `--target-label ${this.targetLabel}`); } } From dbdb754377be7e706705d7fae100259900ea889f Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:23:15 -0700 Subject: [PATCH 36/41] Remove extra log --- azurecontainerapps.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index 4da76c3..adfc1e0 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -578,7 +578,6 @@ export class azurecontainerapps { // If the target label is provided, add it to the command line arguments this.commandLineArgs.push(`--revisions-mode Labels`, `--target-label ${this.targetLabel}`); - this.toolHelper.writeDebug('Added "--revisions-mode Labels" and "--target-label ${this.targetLabel}" to command line arguments.'); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario From fcf85aa3106d028279e5ac9468602748f0d33de1 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 2 Jun 2025 16:24:26 -0700 Subject: [PATCH 37/41] Update index.js --- azurecontainerapps.ts | 1 - dist/index.js | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/azurecontainerapps.ts b/azurecontainerapps.ts index adfc1e0..d11a3b8 100644 --- a/azurecontainerapps.ts +++ b/azurecontainerapps.ts @@ -636,7 +636,6 @@ export class azurecontainerapps { // If the target label is provided, add it to the command line arguments this.commandLineArgs.push(`--revisions-mode Labels`, `--target-label ${this.targetLabel}`); } - } /** diff --git a/dist/index.js b/dist/index.js index 3a63735..c0e8ec4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -645,7 +645,7 @@ var azurecontainerapps = /** @class */ (function () { * file is not provided. */ azurecontainerapps.setupContainerAppProperties = function () { - this.toolHelper.writeInfo("Setting up Container App properties..."); + this.toolHelper.writeDebug("Setting up Container App properties..."); this.commandLineArgs = []; // Get the ingress inputs this.ingress = this.toolHelper.getInput('ingress', false); @@ -665,10 +665,7 @@ var azurecontainerapps = /** @class */ (function () { if (!this.util.isNullOrEmpty(this.targetLabel)) { this.toolHelper.writeDebug('Target label is provided. Setting up command line arguments for revisions mode "Labels".'); // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push("--revisions-mode Labels"); - this.toolHelper.writeDebug('Added "--revisions-mode Labels" to command line arguments.'); - this.commandLineArgs.push("--target-label ".concat(this.targetLabel)); - this.toolHelper.writeDebug("Added \"--target-label ".concat(this.targetLabel, "\" to command line arguments.")); + this.commandLineArgs.push("--revisions-mode Labels", "--target-label ".concat(this.targetLabel)); } // Determine default values only for the 'create' scenario to avoid overriding existing values for the 'update' scenario if (!this.containerAppExists) { @@ -720,8 +717,7 @@ var azurecontainerapps = /** @class */ (function () { } else if (!this.util.isNullOrEmpty(this.targetLabel)) { // If the target label is provided, add it to the command line arguments - this.commandLineArgs.push("--revisions-mode Labels"); - this.commandLineArgs.push("--target-label ".concat(this.targetLabel)); + this.commandLineArgs.push("--revisions-mode Labels", "--target-label ".concat(this.targetLabel)); } }; /** @@ -4841,15 +4837,12 @@ var ContainerAppHelper = /** @class */ (function () { case 1: _a.trys.push([1, 3, , 4]); command_1 = "az containerapp create -n ".concat(containerAppName, " -g ").concat(resourceGroup, " --environment ").concat(environment, " --output none"); - toolHelper.writeInfo("Base command initialized: ".concat(command_1)); optionalCmdArgs.forEach(function (val) { command_1 += " ".concat(val); }); - toolHelper.writeInfo("Final command with optional arguments: ".concat(command_1)); return [4 /*yield*/, util.execute(command_1)]; case 2: _a.sent(); - toolHelper.writeInfo("Container App \"".concat(containerAppName, "\" created successfully.")); return [3 /*break*/, 4]; case 3: err_1 = _a.sent(); @@ -4934,7 +4927,6 @@ var ContainerAppHelper = /** @class */ (function () { return __generator(this, function (_a) { switch (_a.label) { case 0: - toolHelper.writeInfo("Attempting to create Container App with name \"".concat(containerAppName, "\" in resource group \"").concat(resourceGroup, "\" from provided YAML \"").concat(yamlConfigPath, "\"")); toolHelper.writeDebug("Attempting to create Container App with name \"".concat(containerAppName, "\" in resource group \"").concat(resourceGroup, "\" from provided YAML \"").concat(yamlConfigPath, "\"")); _a.label = 1; case 1: From a6e9fc9f4e1aef31c40d6bf7e9786f9f24f9ddf5 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 3 Jun 2025 16:20:01 -0700 Subject: [PATCH 38/41] Re-add a couple test valications --- .github/workflows/run-validation.yml | 111 +++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 033857f..72cfbd8 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -17,6 +17,58 @@ env: TEST_IMAGE_REPOSITORY: github-actions/container-app jobs: + + create-using-provided-dockerfile: + + name: 'Create app using provided Dockerfile' + runs-on: ubuntu-latest + timeout-minutes: 10 + + env: + TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' + TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' + + steps: + - name: Checkout action repository + uses: actions/checkout@v3 + + - name: Clone Oryx repository + uses: actions/checkout@v3 + with: + repository: microsoft/Oryx + path: oryx + + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Execute Azure Container Apps Build and Deploy Action + uses: ./ + with: + appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' + dockerfilePath: 'Dockerfile' + acrName: ${{ vars.TEST_ACR_NAME }} + acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + - name: Delete created Azure Container App + if: ${{ always() }} + shell: bash + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + - name: Delete pushed image + if: ${{ always() }} + shell: bash + run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y + create-using-image-linux: name: 'Create app using image on Linux runner' @@ -195,6 +247,65 @@ jobs: resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + create-using-image-new-env: + + name: 'Create app using image with new environment' + runs-on: ubuntu-latest + timeout-minutes: 25 + + env: + TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' + TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' + + steps: + - name: Checkout action repository + uses: actions/checkout@v3 + + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Execute Azure Container Apps Build and Deploy Action + uses: ./ + with: + imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' + containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }} + resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + - name: Delete created Azure Container App + if: ${{ always() }} + shell: bash + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + - name: Get customer ID for workspace to delete + if: ${{ always() }} + shell: bash + run: | + CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId') + echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV + + - name: Get name of workspace to delete + if: ${{ always() }} + shell: bash + run: | + WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]') + echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV + + - name: Delete created Azure Container App environment + if: ${{ always() }} + shell: bash + run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y + + - name: Delete created workspace + if: ${{ always() }} + shell: bash + run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y + update-using-image-yaml: name: 'Update app using image with YAML configuration' From 9ab9d875d622ef9d9b2315aa45a092c161569a6e Mon Sep 17 00:00:00 2001 From: William Date: Tue, 3 Jun 2025 16:46:26 -0700 Subject: [PATCH 39/41] Update permissions --- .github/workflows/run-validation.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 72cfbd8..f2382bd 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - williamhe/add-labels-support paths-ignore: - '**.md' pull_request: @@ -28,6 +29,10 @@ jobs: TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 @@ -257,6 +262,10 @@ jobs: TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}' TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env' + permissions: + id-token: write + contents: read + steps: - name: Checkout action repository uses: actions/checkout@v3 From 6183519159d3827b6d30601b5c221b48cd0e4999 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 4 Jun 2025 16:04:26 -0700 Subject: [PATCH 40/41] Add validation job --- .github/workflows/run-validation.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index f2382bd..3233642 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -19,6 +19,60 @@ env: jobs: + create-using-found-dockerfile: + + name: 'Create app using found Dockerfile' + runs-on: ubuntu-latest + timeout-minutes: 10 + + env: + TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' + TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout action repository + uses: actions/checkout@v3 + + - name: Clone Oryx repository + uses: actions/checkout@v3 + with: + repository: microsoft/Oryx + path: oryx + + - name: Log in to Azure using UAMI with OIDC + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_UAMI_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Execute Azure Container Apps Build and Deploy Action + uses: ./ + with: + appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' + acrName: ${{ vars.TEST_ACR_NAME }} + acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} + acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} + containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} + containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} + resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} + imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} + disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} + + - name: Delete created Azure Container App + if: ${{ always() }} + shell: bash + run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y + + - name: Delete pushed image + if: ${{ always() }} + shell: bash + run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y + create-using-provided-dockerfile: name: 'Create app using provided Dockerfile' From 110528b9873f0d49d71008934c7b96809b6e537c Mon Sep 17 00:00:00 2001 From: William Date: Wed, 4 Jun 2025 16:26:31 -0700 Subject: [PATCH 41/41] Remove test branch --- .github/workflows/run-validation.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-validation.yml b/.github/workflows/run-validation.yml index 3233642..408deb3 100644 --- a/.github/workflows/run-validation.yml +++ b/.github/workflows/run-validation.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - williamhe/add-labels-support paths-ignore: - '**.md' pull_request: