Skip to content

morzzz007/github-actions-jwt-generator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Actions JWT generator

Do you want to send an HTTP request using HTTPie or CURL with a signed JWT token and wondering how you can create the token for a given payload and secret? Well, look no further!

Installation

- name: JWT Generator
  uses: morzzz007/github-actions-jwt-generator@1.0.1

Usage

The required inputs are secret and payload. It is recommended to store the secret as an encrypted environment variable.

The output where the generated token is in token. To use it in a next step use ${{steps.<step_id>.outputs.token}}. The token is generated with default HMAC SHA256 algorithm.

Example usage

on: [push]

jobs:
  send:
    name: Send new verison
    runs-on: ubuntu-latest
    steps:
      - name: JWT Generator
        id: jwtGenerator
        uses: morzzz007/github-actions-jwt-generator@1.0.1
        with:
          secret: topsecret
          payload: '{"hello":"world"}'
      - name: DUMP Token
        run: echo ${{steps.jwtGenerator.outputs.token}}

About

Generate JWT tokens (JSON Web Tokens)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from actions/typescript-action