Skip to content
eye-off

GitHub Action

paste-secret

v1.1 Latest version

paste-secret

eye-off

paste-secret

Pastes you GitHub secrets to given places

Installation

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

              

- name: paste-secret

uses: bariscanyilmaz/paste-secret@v1.1

Learn more about this action in bariscanyilmaz/paste-secret

Choose a version

Paste-Secret

Paste your GitHub Secrets in files

Usage

Inputs

Required secrets : Secrets ise JSON object array. Holds filename, keys and values which will be replaced

Structure of object array is [{"filename":"TARGETFILE","keys"[{"key":"PARAMETER","value":"YOURSECRETVALUE"} ]}]

Put your keys in curly braces {{PARAMETER}} in target file

Examples

Single line example

example.txt

    Hello {{name}}

Usage In Action

steps:
- uses:bariscanyilmaz/paste-secret@v1
    with:
        secrets:'[{"filename":"example.txt","keys":[{"key":"name","value":"baris"}]}]'

Multi line example

setting.json

{
	"api-url": "{{api}}",
}

config.json

{
    "Username": "{{user}}",
    "Password": "{{passwd}}",
}

Usage In Action

steps:
- uses: bariscanyilmaz/paste-secret@v1
    with:
        secrets: >
        [
            {"filename": "setting.json","keys":[{ "key": "api","value":"192.168.2.1"}]},
            {"filename": "config.json","keys":[{ "key": "user","value":"admin"},{ "key": "passwd","value":"admin123456"}]}
        ]