https://github.com/minddocdev/env-variables-action
Export env variables for Github actions from a JSON or YAML string
https://github.com/minddocdev/env-variables-action
github-actions
Last synced: 12 months ago
JSON representation
Export env variables for Github actions from a JSON or YAML string
- Host: GitHub
- URL: https://github.com/minddocdev/env-variables-action
- Owner: minddocdev
- License: mit
- Created: 2020-01-09T12:48:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:32:51.000Z (over 2 years ago)
- Last Synced: 2025-02-20T01:04:12.693Z (about 1 year ago)
- Topics: github-actions
- Language: JavaScript
- Homepage:
- Size: 1.27 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Env Variables Action
Export env variables for Github actions from a JSON or YAML string.
Install dependencies
```bash
yarn install
```
Build the typescript
```bash
yarn build
```
Run the tests
```bash
yarn test
```
## Inputs
### `variables`
- name: variables
- required: true
- description: The object containing the variables in either JSON or YAML format.
### `format`
- name: format
- required: false
- default: json
- description: Tell the action which format your `variables` are using.
### `whiteList`
- name: whiteList
- required: false
- description: Comma separated list of keys that will be loaded, ignoring the rest.
## Usage
Use the action to export and use env variables:
```yaml
name: 'test-integration'
on:
push:
branches:
- master
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@master
- name: Set env variables using json
uses: minddocdev/env-variables-action@master
with:
variables: '{ "action": "test", "comment": "integration" }'
format: 'json'
whiteList: 'action,comment'
- name: Echo env variables
run: echo $ACTION && echo $COMMENT
- name: Set env variables using yaml
uses: minddocdev/env-variables-action@master
with:
variables: |
'data:
action: test
comment: integration
'
format: 'yaml'
whiteList: 'data.action,data.comment'
- name: Echo env variables
run: echo $ACTION && echo $COMMENT
```