[FEATURE] Auto Oasis Test

This commit is contained in:
Dunemask 2024-02-15 17:42:49 -07:00
parent 32b42eba9f
commit c0af6e77b2

View file

@ -5,11 +5,11 @@ inputs:
infisical-token:
description: 'Infisical API Token'
required: true
environment:
description: 'The environment to fetch secrets for (e.g., staging, production)'
envs:
description: 'The environments to fetch secrets for (Example: ci or ci,prod,edge )'
required: true
secret-path:
description: 'Secret path'
secret-paths:
description: 'Secret paths for the secrets (Must match the order of envs! Example: /main or /main,/alt-main)'
required: true
api-url:
description: 'Infisical API URL (defaults to https://infisical.dunemask.dev/api)'
@ -21,7 +21,31 @@ runs:
- name: Infisical CLI install
shell: bash
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
./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
run: echo "Secrets added to environment!".