infisical fetch-secret can now fetch multiple secrets
publish.yaml / publish (push) Successful in 5s
publish.yaml / publish (push) Successful in 5s
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<!-- action-docs-description source="action.yml" -->
|
||||
## Description
|
||||
|
||||
Fetches a single secret value from Infisical using a machine identity token
|
||||
Fetches one or more secret values from Infisical using a machine identity token
|
||||
<!-- action-docs-description source="action.yml" -->
|
||||
|
||||
<!-- action-docs-inputs source="action.yml" -->
|
||||
@@ -12,9 +12,10 @@ Fetches a single secret value from Infisical using a machine identity token
|
||||
| name | description | required | default |
|
||||
| --- | --- | --- | --- |
|
||||
| `INFISICAL_TOKEN` | <p>Machine identity access token</p> | `true` | `""` |
|
||||
| `SECRET_NAME` | <p>The secret key to fetch</p> | `true` | `""` |
|
||||
| `SECRET_NAME` | <p>A single secret key to fetch; its value is returned base64-encoded in the <code>value</code> output</p> | `false` | `""` |
|
||||
| `SECRET_NAMES` | <p>Secret keys to fetch, separated by newlines, commas, or spaces; each is exported as an environment variable of the same name for subsequent steps</p> | `false` | `""` |
|
||||
| `INFISICAL_HOST` | <p>Infisical API base URL</p> | `false` | `https://infisical.pixelparasol.com` |
|
||||
| `WORKSPACE_ID` | <p>Infisical project UUID</p> | `false` | `""` |
|
||||
| `WORKSPACE_ID` | <p>Infisical project UUID</p> | `true` | `""` |
|
||||
| `ENVIRONMENT` | <p>Infisical environment slug</p> | `false` | `prod` |
|
||||
| `SECRET_PATH` | <p>Folder path within the environment</p> | `false` | `/` |
|
||||
<!-- action-docs-inputs source="action.yml" -->
|
||||
@@ -24,7 +25,7 @@ Fetches a single secret value from Infisical using a machine identity token
|
||||
|
||||
| name | description |
|
||||
| --- | --- |
|
||||
| `value` | <p>The fetched secret value</p> |
|
||||
| `value` | <p>The fetched <code>SECRET_NAME</code> value (base64-encoded)</p> |
|
||||
<!-- action-docs-outputs source="action.yml" -->
|
||||
|
||||
<!-- action-docs-runs source="action.yml" -->
|
||||
@@ -32,3 +33,36 @@ Fetches a single secret value from Infisical using a machine identity token
|
||||
|
||||
This action is a `composite` action.
|
||||
<!-- action-docs-runs source="action.yml" -->
|
||||
|
||||
## 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: <project-uuid>
|
||||
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: <project-uuid>
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user