[FEATURE] Infisical Tool Rewrite
This commit is contained in:
parent
ff0aeadca6
commit
d3da0bda3b
1 changed files with 4 additions and 18 deletions
22
action.yml
22
action.yml
|
@ -5,20 +5,16 @@ 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: '/'
|
||||
required: true
|
||||
api-url:
|
||||
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev)'
|
||||
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev/api)'
|
||||
required: false
|
||||
default: 'https://infisical.dunemask.dev'
|
||||
default: 'https://infisical.dunemask.dev/api'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
|
@ -26,16 +22,6 @@ runs:
|
|||
shell: bash
|
||||
run: |
|
||||
curl -s -L https://github.com/Infisical/infisical/releases/download/infisical-cli%2Fv0.16.10/infisical_0.16.10_linux_amd64.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
|
||||
./infisical export --domain ${{ inputs.api-url }} --token ${{ inputs.infisical-token}} --env ${{ inputs.environment }} --path ${{ inputs.secret-path }} > $GITHUB_ENV
|
||||
- shell: bash
|
||||
run: echo "Secrets added to environment!".
|
Loading…
Add table
Add a link
Reference in a new issue