-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for personal tokens DEVRL-440 (#5)
- Loading branch information
1 parent
a904b58
commit ff1719d
Showing
6 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,39 @@ This action enables you to fetch Doppler secrets for use in your GitHub Actions. | |
## Configuration | ||
|
||
This action requires a [Doppler Service Token](https://docs.doppler.com/docs/service-tokens) to provide read-only access to secrets for a specific Config within a [Project](https://docs.doppler.com/docs/create-project). | ||
The action can be configured in two ways: | ||
|
||
* Service Token (recommended) | ||
* Personal Token with Project and Config | ||
|
||
### Service Token | ||
|
||
A [Doppler Service Token](https://docs.doppler.com/docs/service-tokens) provides read-only access to a single config and is recommended due to its limited access scope. | ||
|
||
Create a GitHub repository secret named `DOPPLER_TOKEN` or if using multiple Service Tokens (e.g. for a Monorepo), you can prefix the secret name using with application name, e.g. `AUTH_API_DOPPLER_TOKEN`. | ||
|
||
Then supply the Service Token using the `doppler-token` input: | ||
|
||
```yaml | ||
- uses: dopplerhq/[email protected] | ||
id: doppler | ||
with: | ||
doppler-token: ${{ secrets.DOPPLER_TOKEN }} | ||
``` | ||
### Personal Token | ||
A Doppler Personal Token provides read/write access to every Project and Config accessible for that account and should only be used when necessary. The `doppler-project` and `doppler-config` inputs must be provided when using a Personal Token: | ||
|
||
```yaml | ||
- uses: dopplerhq/[email protected] | ||
id: doppler | ||
with: | ||
doppler-token: ${{ secrets.PERSONAL_DOPPLER_TOKEN }} | ||
doppler-project: auth-api | ||
doppler-config: ci-cd | ||
``` | ||
|
||
## Usage | ||
|
||
Secrets can be accessed in two ways: | ||
|
@@ -30,7 +59,7 @@ jobs: | |
secrets-fetch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: doppleruniversity/secrets-fetch-action@v1 | ||
- uses: dopplerhq/secrets-fetch-action@v1.1.0 | ||
id: doppler | ||
with: | ||
doppler-token: ${{ secrets.DOPPLER_TOKEN }} | ||
|
@@ -53,7 +82,7 @@ jobs: | |
secrets-fetch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: doppleruniversity/secrets-fetch-action@v0.0.1 | ||
- uses: dopplerhq/secrets-fetch-action@v1.1.0 | ||
id: doppler | ||
with: | ||
doppler-token: ${{ secrets.DOPPLER_TOKEN }} | ||
|
@@ -67,4 +96,8 @@ All secret values are masked with the exception of the Doppler meta variables: | |
|
||
- `DOPPLER_PROJECT` | ||
- `DOPPLER_ENVIRONMENT` | ||
- `DOPPLER_CONFIG` | ||
- `DOPPLER_CONFIG` | ||
|
||
# Development and Testing | ||
|
||
Export the `NODE_ENV` and `DOPPLER_TOKEN` environment variables, then run `npm test`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters