From 330dc0b5b8436e94727c91598c6a6ffc9fddc2e7 Mon Sep 17 00:00:00 2001 From: Sourav Chanduka Date: Wed, 28 Jul 2021 14:01:17 +0530 Subject: [PATCH] Updated Readme --- packages/oidc-client/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/oidc-client/README.md b/packages/oidc-client/README.md index 8998dafc..e14194b4 100644 --- a/packages/oidc-client/README.md +++ b/packages/oidc-client/README.md @@ -12,15 +12,22 @@ Method Name: getIDToken audience : optional +You can use this [template](https://github.com/actions/typescript-action) to use the package.

Example:

+main.ts ``` const core = require('@actions/core'); const id = require('@actions/oidc-client') -async function getID(){ - const id_token = await id.getIDToken('client-id', 'client-secret') +async function getID(): Promise { + + let aud = '' + const audience = core.getInput('audience', {required: false}) + if (audience !== undefined) + aud = `${audience}` + const id_token = await id.getIDToken(aud) const val = `ID token is ${id_token}` core.setOutput('id_token', id_token); @@ -28,3 +35,19 @@ async function getID(){ getID() ``` + +actions.yml +``` +name: 'GetIDToken' +description: 'Get ID token from Github OIDC provider' +inputs: + audience: + description: 'Audience for which the ID token is intended for' + required: false +outputs: + id_token: + description: 'ID token obtained from OIDC provider' +runs: + using: 'node12' + main: 'dist/index.js' +```