Skip to content

Commit

Permalink
Use Javascript Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Sawthis committed Apr 4, 2024
1 parent 231c34d commit bd99d45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/actions/expose-jwt-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
outputs:
jwt: # id of output
description: 'The signed JWT ID Token'
value: ${{ steps.random-number-generator.outputs.random-number }}
value: ${{ steps.expose-jwt.outputs.jwt }}
runs:
using: "composite"
steps:
Expand All @@ -22,7 +22,10 @@ runs:
cd .github/actions/expose-jwt-action
npm init -y
npm install @actions/core
node index.js
shell: bash
env:
INPUT_AUDIENCE: ${{ inputs.audience }}
- uses: .github/actions/expose-jwt-action
id: expose-jwt
- run: echo "JWT in bash $UTPUT_JWT."
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/expose-jwt-action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const core = require('@actions/core');
async function run() {
try {
// Get aud and request token
const audience = process.env.NPUT_AUDIENCE;
const audience = core.getInput('audience');
console.log(`audience in javascript ${audience}`);
const jwt = await core.getIDToken(audience);
core.setOutput("jwt", jwt);
core.exportVariable('JWT', jwt);
core.exportVariable('OUTPUT_JWT', jwt);
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit bd99d45

Please sign in to comment.