Skip to content
lock

GitHub Action

Secret Parser lite

v1.0.1 Latest version
Use latest version
lock

Secret Parser lite

Replaces GitHub Actions secrets referenced in files with their raw values

Installation

Copy and paste the following snippet into your .yml file.

- name: Secret Parser lite
  uses: yegobox/secret-parser@v1.0.1
Learn more about this action in yegobox/secret-parser
Choose a version

Secret Parser Action

Replaces GitHub Actions secrets referenced in files with their raw values.

Inputs

filename

Required File where GitHub Actions Secrets references should be parsed and replaced.

secret-name

Required Name of secret to search for in the designated file.

secret-value

Required Value of secret to replace reference with in designated file.

Example usage

  1. Create a file in the repository which references GitHub actions secret. For example, test.json:
{
  "important_value" : "${{ secrets.important_value }}"
}
  1. Create a GitHub action secret with a key of: important_value

  2. Add the following to your workflow configuration file (parameters shown below are for this demonstration only):

uses: yegobox/secret-parser@v1.0.1
with:
  filename: test.json
  secret-name: important_value
  secret-value: ${{ secrets.important_value }}
  1. During workflow execution, test.json (or a file of one's choosing) will be parsed and the reference to a GitHub secret will be replaced with the corresponding secret value.