41 lines
No EOL
1.6 KiB
YAML
41 lines
No EOL
1.6 KiB
YAML
# Based on https://github.com/zerodays/action-infisical/blob/master/action.yml
|
|
name: 'Elysium Infisical Secrets'
|
|
description: 'Fetch secrets from Infisical and add them to the env'
|
|
inputs:
|
|
infisical-token:
|
|
description: 'Infisical API Token'
|
|
required: true
|
|
workspace-id:
|
|
description: 'Infisical Workspace ID'
|
|
required: true
|
|
environment:
|
|
description: 'The environment to fetch secrets for (e.g., staging, production)'
|
|
required: true
|
|
secret-path:
|
|
description: 'Secret path (defaults to /)'
|
|
required: false
|
|
default: '/'
|
|
api-url:
|
|
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev)'
|
|
required: false
|
|
default: 'https://infisical.dunemask.dev'
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Infisical CLI install
|
|
shell: bash
|
|
run: |
|
|
curl -s -L https://github.com/Infisical/infisical/releases/download/infisical-cli%2Fv0.16.10/infisical_0.16.10_linux_armv6.tar.gz | tar xvz
|
|
./infisical
|
|
- name: Install JQ
|
|
shell: bash
|
|
run: |
|
|
curl https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64 >> ./jq
|
|
- name: Fetch secrets from Infisical and add them to the environment
|
|
shell: bash
|
|
run: |
|
|
curl "${{ inputs.api-url }}/api/v3/secrets/raw?environment=${{ inputs.environment }}&secretPath=${{ inputs.secret-path }}&workspaceId=${{ inputs.workspace-id }}" \
|
|
--header "Authorization: Bearer ${{ inputs.infisical-token }}" \
|
|
| ./jq -r '.secrets[] | "\(.secretKey)=\(.secretValue)"' > $GITHUB_ENV
|
|
- shell: bash
|
|
run: echo "Secrets added to environment!". |