Compare commits

...
Sign in to create a new pull request.

40 commits

Author SHA1 Message Date
38e09a889e [CHORE] Adjust Action Logging 2024-08-25 11:28:16 -06:00
5ef63ab264 [CHORE] Adjust Action Logging 2024-08-25 11:24:54 -06:00
3974280be1 [CHORE] Adjust Action Logging 2024-08-25 11:21:28 -06:00
b9a859a564 [CHORE] Tweak Secret Usage 2024-08-24 20:59:11 -06:00
a3c0631d4e [CHORE] Tweak Secret Usage 2024-08-24 20:54:04 -06:00
b43d358049 [CHORE] Tweak Secret Usage 2024-08-24 20:53:09 -06:00
e80855f926 [CHORE] Tweak Secret Usage 2024-08-24 20:50:19 -06:00
c654300503 [CHORE] Tweak Secret Usage 2024-08-24 20:49:46 -06:00
aefb84fb1b [CHORE] Tweak Secret Usage 2024-08-24 20:49:05 -06:00
11fe49dd2a [CHORE] Tweak Action Inputs 2024-08-24 20:05:35 -06:00
83fa63b974 [CHORE] Tweak Action Inputs 2024-08-24 17:56:41 -06:00
c68bdd608e [CHORE] Tweak Action Version 2024-08-24 17:41:11 -06:00
1ef60cb33e [HOTFIX] Workflow Overhaul 2024-02-20 03:22:04 -07:00
4334357d8a [HOTFIX] Workflow Overhaul 2024-02-20 03:19:30 -07:00
47f82efb19 [HOTFIX] Workflow Overhaul 2024-02-20 03:17:07 -07:00
7b8cad752d [HOTFIX] Workflow Overhaul 2024-02-20 03:15:06 -07:00
54f15e6bd5 [HOTFIX] Workflow Overhaul 2024-02-20 03:14:06 -07:00
83b09537fc [HOTFIX] Workflow Overhaul 2024-02-20 03:13:15 -07:00
1d43d3ed6c [HOTFIX] Envar Fetch Adjust 2024-02-17 00:33:24 -07:00
0d01e5b511 [HOTFIX] Envar Fetch Adjust 2024-02-17 00:32:19 -07:00
c7befd3e3d [HOTFIX] Envar adjust 2024-02-17 00:29:19 -07:00
dunemask
068503bed5 [FEATURE] Adjust URLS 2024-02-15 18:26:46 -07:00
d1f7d84304 [FEATURE] Infisical Secrets 2024-02-15 18:26:07 -07:00
50ef239109 [FEATURE] Auto Oasis Test 2024-02-15 18:14:40 -07:00
a371dec5d3 [FEATURE] Auto Oasis Test 2024-02-15 18:04:03 -07:00
4f8f4de829 [FEATURE] Auto Oasis Test 2024-02-15 18:02:58 -07:00
41772954b5 [FEATURE] Auto Oasis Test 2024-02-15 18:02:30 -07:00
ee47f45ec9 [FEATURE] Auto Oasis Test 2024-02-15 18:01:45 -07:00
53ffe7cfe9 [FEATURE] Auto Oasis Test 2024-02-15 17:59:32 -07:00
e77c10a17b [FEATURE] Auto Oasis Test 2024-02-15 17:51:14 -07:00
c0af6e77b2 [FEATURE] Auto Oasis Test 2024-02-15 17:42:49 -07:00
32b42eba9f [FEATURE] Auto Oasis Test 2024-02-15 16:20:07 -07:00
fb438ca8dd [FEATURE] Auto Oasis Test 2024-02-15 16:18:13 -07:00
4a9785db44 [FEATURE] Updtae env save 2024-02-14 20:02:38 -07:00
fc823beac6 [FEATURE] Infisical Tool Rewrite 2024-02-14 19:52:17 -07:00
d3da0bda3b [FEATURE] Infisical Tool Rewrite 2024-02-14 19:50:41 -07:00
ff0aeadca6 [FEATURE] Fixed Platform 2024-02-14 16:47:02 -07:00
7c1632caaf [FEATURE] Test Infisical Install 2024-02-14 16:44:28 -07:00
6ecc42fde5 [TEST] Initial switch to elysium-actions 2024-02-14 00:17:25 -07:00
3c8fd06967 [FEATURE] Infisical Env Action 2024-02-13 23:37:58 -07:00
2 changed files with 67 additions and 1 deletions

View file

@ -6,8 +6,9 @@ The actions are used by Elysium to run CI/CD tasks and this repo will be archive
The actions available are:
- [S3 Backup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/s3-backup/action.yml)
- [Oasis Deploy](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-deploy/action.yml)
- [Oasis Auto Setup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-setup-auto/action.yml)
- [Infisical Env](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/infisical-env/action.yml)
- [Oasis Advanced Setup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-setup-advanced/action.yml)
- [Elysium CI/CD](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/elysium-ci-cd/action.yml)
## Workflow Template

65
action.yml Normal file
View file

@ -0,0 +1,65 @@
name: "Elysium Infisical Secrets"
description: "Fetch secrets from Infisical and add them to the env"
inputs:
infisical-token:
description: "Infisical API Token"
required: true
project-id:
description: "Project to retrieve secrets from using token"
required: true
secret-envs:
description: "The environments to fetch secrets for (Example: ci or ci,prod,edge )"
required: true
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)"
required: false
default: "https://infisical.dunemask.dev/api"
runs:
using: "composite"
steps:
- name: Infisical CLI install
shell: bash
run: |
[ -z "${{ inputs.project-id }}" ] && echo "ProjectID was not supplied!" && exit 1
[ -z "${{ inputs.infisical-token }}" ] && echo "Inficial token was not supplied!" && exit 1
# Install Infisical Binary
echo "Installing Infisical!"
curl -s -L https://github.com/Infisical/infisical/releases/download/infisical-cli%2Fv0.28.5/infisical_0.28.5_linux_amd64.tar.gz | tar xvzf - infisical
# Install yq
echo "Installing yq"
curl -s -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 >> yq
chmod +x yq
# Get paths and envs into list
paths="${{ inputs.secret-paths }}"
envs="${{ inputs.secret-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 "Each path must specify it's environment!"
exit 1;
fi
echo "Will execute ./infisical export --domain ${{ inputs.api-url }} --projectId ${{ inputs.project-id }} --token TOKEN --env ENV --path PATH"
# 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 }} --projectId ${{ inputs.project-id }} --token ${{ inputs.infisical-token }} --env "${env_list[i]}" --path "${path_list[i]}" --format yaml | tee >(./yq -r 'to_entries[] | .key + "=" +.value' >> $GITHUB_ENV) | ./yq -r 'to_entries[] | "echo ::add-mask::\"" + .value + "\""' >> mask.sh
chmod +x mask.sh
./mask.sh
rm mask.sh
done
- shell: bash
run: echo "Secrets added to environment!"