Skip to content

Commit db4d376

Browse files
committed
feat(actions): add Azure/login@v2
1 parent 2a80a10 commit db4d376

5 files changed

Lines changed: 172 additions & 2 deletions

File tree

actions/Azure/login/v2/action

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8c334a195cbb38e46038007b304988d888bf676a

docs/supported-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Click on a version to see the binding's code.
4242
* [googlejavaformat-action](https://github.com/axel-op/googlejavaformat-action) - v3: [`GooglejavaformatActionV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/axelop/GooglejavaformatActionV3.kt)
4343
* Azure
4444
* [docker-login](https://github.com/Azure/docker-login) - v1: [`DockerLoginV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/DockerLoginV1.kt)
45-
* [login](https://github.com/Azure/login) - v1: [`LoginV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/LoginV1.kt)
45+
* [login](https://github.com/Azure/login) - v1: [`LoginV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/LoginV1.kt), v2: [`LoginV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/LoginV2.kt)
4646
* [webapps-deploy](https://github.com/Azure/webapps-deploy) - v2: [`WebappsDeployV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/WebappsDeployV2.kt), v3: [`WebappsDeployV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/WebappsDeployV3.kt)
4747
* bahmutov
4848
* [npm-install](https://github.com/bahmutov/npm-install) - v1: [`NpmInstallV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/bahmutov/NpmInstallV1.kt)
@@ -141,6 +141,6 @@ Click on a version to see the binding's code.
141141
Number of bindings available:
142142

143143
* counting by actions: 85
144-
* counting each version separately: 158
144+
* counting each version separately: 159
145145

146146
Actions [providing typings](https://github.com/typesafegithub/github-actions-typing/) (marked with ✅ on the above list): 18

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/azure/LoginV1.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@file:Suppress(
55
"DataClassPrivateConstructor",
66
"UNUSED_PARAMETER",
7+
"DEPRECATION",
78
)
89

910
package io.github.typesafegithub.workflows.actions.azure
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
1415
import kotlin.Boolean
16+
import kotlin.Deprecated
1517
import kotlin.String
1618
import kotlin.Suppress
1719
import kotlin.Unit
@@ -46,6 +48,10 @@ import kotlin.collections.toTypedArray
4648
* @param _customVersion Allows overriding action's version, for example to use a specific minor
4749
* version, or a newer version that the binding doesn't yet know about
4850
*/
51+
@Deprecated(
52+
message = "This action has a newer major version: LoginV2",
53+
replaceWith = ReplaceWith("LoginV2"),
54+
)
4955
public data class LoginV1 private constructor(
5056
/**
5157
* Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
2+
// changes will be overwritten with the next binding code regeneration.
3+
// See https://github.com/typesafegithub/github-workflows-kt for more info.
4+
@file:Suppress(
5+
"DataClassPrivateConstructor",
6+
"UNUSED_PARAMETER",
7+
)
8+
9+
package io.github.typesafegithub.workflows.actions.azure
10+
11+
import io.github.typesafegithub.workflows.domain.actions.Action
12+
import io.github.typesafegithub.workflows.domain.actions.RegularAction
13+
import java.util.LinkedHashMap
14+
import kotlin.Boolean
15+
import kotlin.String
16+
import kotlin.Suppress
17+
import kotlin.Unit
18+
import kotlin.collections.Map
19+
import kotlin.collections.toList
20+
import kotlin.collections.toTypedArray
21+
22+
/**
23+
* Action: Azure Login
24+
*
25+
* Authenticate to Azure and run your Azure CLI or Azure PowerShell based actions or scripts.
26+
*
27+
* [Action on GitHub](https://github.com/Azure/login)
28+
*
29+
* @param creds Paste output of `az ad sp create-for-rbac` as value of secret variable:
30+
* AZURE_CREDENTIALS
31+
* @param clientId ClientId of the Azure Service principal created.
32+
* @param tenantId TenantId of the Azure Service principal created.
33+
* @param subscriptionId Azure subscriptionId
34+
* @param enableAzPSSession Set this value to true to enable Azure PowerShell Login in addition to
35+
* Azure CLI login
36+
* @param environment Name of the environment. Supported values are azurecloud, azurestack,
37+
* azureusgovernment, azurechinacloud, azuregermancloud. Default being azurecloud
38+
* @param allowNoSubscriptions Set this value to true to enable support for accessing tenants
39+
* without subscriptions
40+
* @param audience Provide audience field for access-token. Default value is
41+
* api://AzureADTokenExchange
42+
* @param authType The type of authentication. Supported values are SERVICE_PRINCIPAL, IDENTITY.
43+
* Default value is SERVICE_PRINCIPAL
44+
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
45+
* the binding
46+
* @param _customVersion Allows overriding action's version, for example to use a specific minor
47+
* version, or a newer version that the binding doesn't yet know about
48+
*/
49+
public data class LoginV2 private constructor(
50+
/**
51+
* Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS
52+
*/
53+
public val creds: String? = null,
54+
/**
55+
* ClientId of the Azure Service principal created.
56+
*/
57+
public val clientId: String? = null,
58+
/**
59+
* TenantId of the Azure Service principal created.
60+
*/
61+
public val tenantId: String? = null,
62+
/**
63+
* Azure subscriptionId
64+
*/
65+
public val subscriptionId: String? = null,
66+
/**
67+
* Set this value to true to enable Azure PowerShell Login in addition to Azure CLI login
68+
*/
69+
public val enableAzPSSession: Boolean? = null,
70+
/**
71+
* Name of the environment. Supported values are azurecloud, azurestack, azureusgovernment,
72+
* azurechinacloud, azuregermancloud. Default being azurecloud
73+
*/
74+
public val environment: LoginV2.Environment? = null,
75+
/**
76+
* Set this value to true to enable support for accessing tenants without subscriptions
77+
*/
78+
public val allowNoSubscriptions: Boolean? = null,
79+
/**
80+
* Provide audience field for access-token. Default value is api://AzureADTokenExchange
81+
*/
82+
public val audience: String? = null,
83+
/**
84+
* The type of authentication. Supported values are SERVICE_PRINCIPAL, IDENTITY. Default value
85+
* is SERVICE_PRINCIPAL
86+
*/
87+
public val authType: LoginV2.AuthType? = null,
88+
/**
89+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
90+
*/
91+
public val _customInputs: Map<String, String> = mapOf(),
92+
/**
93+
* Allows overriding action's version, for example to use a specific minor version, or a newer
94+
* version that the binding doesn't yet know about
95+
*/
96+
public val _customVersion: String? = null,
97+
) : RegularAction<Action.Outputs>("Azure", "login", _customVersion ?: "v2") {
98+
public constructor(
99+
vararg pleaseUseNamedArguments: Unit,
100+
creds: String? = null,
101+
clientId: String? = null,
102+
tenantId: String? = null,
103+
subscriptionId: String? = null,
104+
enableAzPSSession: Boolean? = null,
105+
environment: LoginV2.Environment? = null,
106+
allowNoSubscriptions: Boolean? = null,
107+
audience: String? = null,
108+
authType: LoginV2.AuthType? = null,
109+
_customInputs: Map<String, String> = mapOf(),
110+
_customVersion: String? = null,
111+
) : this(creds=creds, clientId=clientId, tenantId=tenantId, subscriptionId=subscriptionId,
112+
enableAzPSSession=enableAzPSSession, environment=environment,
113+
allowNoSubscriptions=allowNoSubscriptions, audience=audience, authType=authType,
114+
_customInputs=_customInputs, _customVersion=_customVersion)
115+
116+
@Suppress("SpreadOperator")
117+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
118+
*listOfNotNull(
119+
creds?.let { "creds" to it },
120+
clientId?.let { "client-id" to it },
121+
tenantId?.let { "tenant-id" to it },
122+
subscriptionId?.let { "subscription-id" to it },
123+
enableAzPSSession?.let { "enable-AzPSSession" to it.toString() },
124+
environment?.let { "environment" to it.stringValue },
125+
allowNoSubscriptions?.let { "allow-no-subscriptions" to it.toString() },
126+
audience?.let { "audience" to it },
127+
authType?.let { "auth-type" to it.stringValue },
128+
*_customInputs.toList().toTypedArray(),
129+
).toTypedArray()
130+
)
131+
132+
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
133+
134+
public sealed class Environment(
135+
public val stringValue: String,
136+
) {
137+
public object Azurecloud : LoginV2.Environment("azurecloud")
138+
139+
public object Azurestack : LoginV2.Environment("azurestack")
140+
141+
public object Azureusgovernment : LoginV2.Environment("azureusgovernment")
142+
143+
public object Azurechinacloud : LoginV2.Environment("azurechinacloud")
144+
145+
public object Azuregermancloud : LoginV2.Environment("azuregermancloud")
146+
147+
public class Custom(
148+
customStringValue: String,
149+
) : LoginV2.Environment(customStringValue)
150+
}
151+
152+
public sealed class AuthType(
153+
public val stringValue: String,
154+
) {
155+
public object ServicePrincipal : LoginV2.AuthType("SERVICE_PRINCIPAL")
156+
157+
public object Identity : LoginV2.AuthType("IDENTITY")
158+
159+
public class Custom(
160+
customStringValue: String,
161+
) : LoginV2.AuthType(customStringValue)
162+
}
163+
}

0 commit comments

Comments
 (0)