[FEATURE] Auto Oasis Test
This commit is contained in:
parent
32b42eba9f
commit
c0af6e77b2
1 changed files with 29 additions and 5 deletions
34
action.yml
34
action.yml
|
@ -5,11 +5,11 @@ inputs:
|
||||||
infisical-token:
|
infisical-token:
|
||||||
description: 'Infisical API Token'
|
description: 'Infisical API Token'
|
||||||
required: true
|
required: true
|
||||||
environment:
|
envs:
|
||||||
description: 'The environment to fetch secrets for (e.g., staging, production)'
|
description: 'The environments to fetch secrets for (Example: ci or ci,prod,edge )'
|
||||||
required: true
|
required: true
|
||||||
secret-path:
|
secret-paths:
|
||||||
description: 'Secret path'
|
description: 'Secret paths for the secrets (Must match the order of envs! Example: /main or /main,/alt-main)'
|
||||||
required: true
|
required: true
|
||||||
api-url:
|
api-url:
|
||||||
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev/api)'
|
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev/api)'
|
||||||
|
@ -21,7 +21,31 @@ runs:
|
||||||
- name: Infisical CLI install
|
- name: Infisical CLI install
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
# Install Infisical Binary
|
||||||
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
|
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 export --domain ${{ inputs.api-url }} --token ${{ inputs.infisical-token}} --env ${{ inputs.environment }} --path ${{ inputs.secret-path }} >> $GITHUB_ENV
|
|
||||||
|
# Get paths and envs into list
|
||||||
|
paths="${{ inputs.secret-paths }}"
|
||||||
|
envs="${{ inputs.envs }}"
|
||||||
|
|
||||||
|
path_list=( $(echo $paths | sed "s/,/ /g") )
|
||||||
|
env_list=( $(echo $envs | sed "s/,/ /g") )
|
||||||
|
path_len=${#path_list[@]}
|
||||||
|
env_len=${#env_list[@]}
|
||||||
|
|
||||||
|
# Ensure lengths match
|
||||||
|
if [ $path_len != $env_len ];
|
||||||
|
then
|
||||||
|
echo "Input must match the output!"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For each environment
|
||||||
|
for i in "${!path_list[@]}";
|
||||||
|
do
|
||||||
|
echo "Getting secrets from path '${path_list[i]}' from '${env_list[i]}'"
|
||||||
|
./infisical export --domain ${{ inputs.api-url }} --token ${{ inputs.infisical-token}} --env "${env_list[i]}" --path "${path_list[i]}" >> $GITHUB_ENV;
|
||||||
|
done
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: echo "Secrets added to environment!".
|
run: echo "Secrets added to environment!".
|
Loading…
Add table
Add a link
Reference in a new issue