From 3c8fd06967eaf97b97964ebf312493c5b930ace0 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Tue, 13 Feb 2024 23:37:58 -0700 Subject: [PATCH] [FEATURE] Infisical Env Action --- action.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..4a950bf --- /dev/null +++ b/action.yml @@ -0,0 +1,32 @@ +# 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: 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!". \ No newline at end of file