# Fetch Secret from Infisical ## Description Fetches one or more secret values from Infisical using a machine identity token ## Inputs | name | description | required | default | | --- | --- | --- | --- | | `INFISICAL_TOKEN` |

Machine identity access token

| `true` | `""` | | `SECRET_NAME` |

A single secret key to fetch; its value is returned base64-encoded in the value output

| `false` | `""` | | `SECRET_NAMES` |

Secret keys to fetch, separated by newlines, commas, or spaces; each is exported as an environment variable of the same name for subsequent steps

| `false` | `""` | | `INFISICAL_HOST` |

Infisical API base URL

| `false` | `https://infisical.pixelparasol.com` | | `WORKSPACE_ID` |

Infisical project UUID

| `true` | `""` | | `ENVIRONMENT` |

Infisical environment slug

| `false` | `prod` | | `SECRET_PATH` |

Folder path within the environment

| `false` | `/` | ## Outputs | name | description | | --- | --- | | `value` |

The fetched SECRET_NAME value (base64-encoded)

| ## Runs This action is a `composite` action. ## Usage ### Multiple secrets Each name in `SECRET_NAMES` is exported as an environment variable of the same name (raw value, not base64) to all subsequent steps in the job. Names must be valid environment variable names. The action fails if any secret is missing. ```yaml - uses: pixel-parasol-public/gitea-actions/infisical/fetch-secret@main with: INFISICAL_TOKEN: ${{ secrets.INFISICAL_TOKEN }} WORKSPACE_ID: SECRET_NAMES: | DATABASE_URL API_KEY - run: ./deploy.sh # $DATABASE_URL and $API_KEY are set ``` ### Single secret ```yaml - id: secret uses: pixel-parasol-public/gitea-actions/infisical/fetch-secret@main with: INFISICAL_TOKEN: ${{ secrets.INFISICAL_TOKEN }} WORKSPACE_ID: SECRET_NAME: DATABASE_URL - run: echo "${{ steps.secret.outputs.value }}" | base64 -d > db_url ``` `SECRET_NAME` and `SECRET_NAMES` can be combined in one call.