https://github.com/sammcj/dotenv-output-action
Github Action that reads .env files and provides it's contents as outputs.
https://github.com/sammcj/dotenv-output-action
Last synced: 6 months ago
JSON representation
Github Action that reads .env files and provides it's contents as outputs.
- Host: GitHub
- URL: https://github.com/sammcj/dotenv-output-action
- Owner: sammcj
- License: mit
- Created: 2022-11-28T03:21:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T09:10:18.000Z (10 months ago)
- Last Synced: 2025-04-10T07:01:10.445Z (6 months ago)
- Language: JavaScript
- Size: 268 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 240
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dotenv output action
This Github Action reads items from provided environment file (`.env`) and provides outputs with their values.
## Build history
[](https://github.com/sammcj/dotenv-output-action/actions)
## Inputs
- `path` - Override the path to the `.env` file. Default is `.env` in the repository root.
- `log-variables` - Log variables after reading from the `.env` file and output a table to the workflow [summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary) (default: `true`).
- `mask-variables` - [Mask](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#masking-a-value-in-log) values after reading from the `.env` file (default: `false`).## Outputs
- `generic` - Whatever is present in the `.env` file will be converted into an output variable.
E.g. you have the following `.env`:
```yaml
VERSION=1.0
AUTHOR=Mickey Mouse
MYARRAY=1,2,3
```Then you will have outputs:
- `version`: `1.0`
- `author`: `Mickey Mouse`
- `myarray`: `1,2,3`
- `myarray_element_0`: `1`
- `myarray_element_1`: `2`
- `myarray_element_2`: `3`## Example usage
Assuming the following .env file:
```.env
hello=world
``````yaml
- name: dotenv
id: dotenv
uses: sammcj/dotenv-output-action@main- name: echo hello world
run: echo "hello ${{ steps.dotenv.outputs.hello }}"
# Will output "Hello world"
```Full example:
```yaml
- name: dotenv
id: dotenv
uses: sammcj/dotenv-output-action@main
with:
path: .github/.github.env
log-variables: true
mask-variables: false
```## Screenshot

## Credits
- Originally forked from [falti/dotenv-action](https://github.com/falti/dotenv-action)