1
0
Fork 0

default aud parameter

pull/887/head
Sourav Chanduka 2021-08-18 16:53:54 +05:30
parent 1c03cd3284
commit 1f8d7b5a64
2 changed files with 7 additions and 3 deletions

View File

@ -278,7 +278,9 @@ const core = require('@actions/core');
async function getIDTokenAction(): Promise<void> {
const audience = core.getInput('audience', {required: false})
const id_token = await core.getIDToken(audience)
const id_token1 = await core.getIDToken() // ID Token with default audience
const id_token2 = await core.getIDToken(audience) // ID token with custom audience
// this id_token can be used to get access token from third party cloud providers
}
@ -295,7 +297,9 @@ inputs:
description: 'Audience for which the ID token is intended for'
required: false
outputs:
id_token:
id_token1:
description: 'ID token obtained from OIDC provider'
id_token2:
description: 'ID token obtained from OIDC provider'
runs:
using: 'node12'

View File

@ -351,6 +351,6 @@ export function getState(name: string): string {
return process.env[`STATE_${name}`] || ''
}
export async function getIDToken(aud = undefined): Promise<string> {
export async function getIDToken(aud: string | undefined = undefined): Promise<string> {
return await OidcClient.getIDToken(aud)
}