Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2102d71
Add labels support
williamhernandezlimon May 23, 2025
97f7dce
Remove RevisionMode
williamhernandezlimon May 27, 2025
00efeea
Revert accidental deletion
williamhernandezlimon May 27, 2025
9117bd5
Update azure login to use UAMI with OIDC
williamhernandezlimon May 28, 2025
46091a5
Test update
williamhernandezlimon May 28, 2025
6196c0d
Update description
williamhernandezlimon May 28, 2025
8473536
Update arg
williamhernandezlimon May 28, 2025
a60e101
Add permissions
williamhernandezlimon May 29, 2025
805e618
Add permissions
williamhernandezlimon May 29, 2025
6cbe52c
Remove builder steps
williamhernandezlimon May 29, 2025
612d251
Add target labels params
williamhernandezlimon May 29, 2025
2cfa386
Test commi
williamhernandezlimon May 29, 2025
75d9c5c
Add active revisions mode param
williamhernandezlimon May 30, 2025
adde5e7
Add active revisions mode param
williamhernandezlimon May 30, 2025
a8848e7
Add active revisions mode param
williamhernandezlimon May 30, 2025
5d13023
Remove oidc workflow
williamhernandezlimon May 30, 2025
4e933df
Add test log
williamhernandezlimon May 30, 2025
82cd02f
Add target labels params
williamhernandezlimon May 30, 2025
61242a5
Remove oidc workflow
williamhernandezlimon May 30, 2025
93275dc
Update target label params
williamhernandezlimon May 30, 2025
653424c
Update logs
williamhernandezlimon May 30, 2025
e048817
Update param
williamhernandezlimon May 30, 2025
72d174c
Update logs
williamhernandezlimon May 30, 2025
d966619
Update logs
williamhernandezlimon May 30, 2025
64608b1
Update index.js
williamhernandezlimon May 30, 2025
80aacac
Update index.js
williamhernandezlimon May 30, 2025
83fdac7
Update index.js
williamhernandezlimon May 31, 2025
03c324f
Update workflow
williamhernandezlimon May 31, 2025
c772872
Update workflow
williamhernandezlimon May 31, 2025
aaf47d7
Update comment
williamhernandezlimon May 31, 2025
55d3499
Update comment
williamhernandezlimon May 31, 2025
7e5cc92
Remove extra logs
williamhernandezlimon Jun 2, 2025
fba7a6a
Remove test branch
williamhernandezlimon Jun 2, 2025
d58b88d
Remove unnecessary wait
williamhernandezlimon Jun 2, 2025
f800599
Update with code review suggesstions
williamhernandezlimon Jun 2, 2025
dbdb754
Remove extra log
williamhernandezlimon Jun 2, 2025
fcf85aa
Update index.js
williamhernandezlimon Jun 2, 2025
a6e9fc9
Re-add a couple test valications
williamhernandezlimon Jun 3, 2025
9ab9d87
Update permissions
williamhernandezlimon Jun 3, 2025
6183519
Add validation job
williamhernandezlimon Jun 4, 2025
110528b
Remove test branch
williamhernandezlimon Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
679 changes: 0 additions & 679 deletions .github/workflows/run-validation-oidc.yml

This file was deleted.

433 changes: 109 additions & 324 deletions .github/workflows/run-validation.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +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 new revisions. Will be injected into the YAML config under `properties.configuration.targetLabel` if provided. |

## Usage

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ 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'
targetLabel:
description: |
'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'
main: 'dist/index.js'
19 changes: 19 additions & 0 deletions azurecontainerapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class azurecontainerapps {
private static buildArguments: string;
private static noIngressUpdate: boolean;
private static useInternalRegistry: boolean;
private static targetLabel: string;

/**
* Initializes the helpers used by this task.
Expand Down Expand Up @@ -160,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);

Expand Down Expand Up @@ -545,6 +548,7 @@ export class azurecontainerapps {
* file is not provided.
*/
private static setupContainerAppProperties() {
this.toolHelper.writeDebug(`Setting up Container App properties...`);
this.commandLineArgs = [];

// Get the ingress inputs
Expand All @@ -567,6 +571,15 @@ export class azurecontainerapps {
`--registry-password ${this.registryPassword}`);
}


// Handle TargetLabel setup when activeRevisionsMode is Labels
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`, `--target-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;
Expand Down Expand Up @@ -619,18 +632,24 @@ 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(`--revisions-mode Labels`, `--target-label ${this.targetLabel}`);
}
}

/**
* 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);
}
Expand Down
Loading
Loading