@actions/oidc-client

Usage

You can use this package to interact with the GitHub OIDC provider and get a JWT ID token which would help to get access token from third party cloud providers.

Get the ID token

Method Name: getIDToken

Inputs

audience : optional

Outputs

A [JWT](https://jwt.io/) ID Token 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 getIDTokenAction(): 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); } getIDTokenAction() ``` 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' ```