Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allenevans/set-env
Programmatically set github action global environment variables that can be used in subsequent steps
https://github.com/allenevans/set-env
Last synced: 2 months ago
JSON representation
Programmatically set github action global environment variables that can be used in subsequent steps
- Host: GitHub
- URL: https://github.com/allenevans/set-env
- Owner: allenevans
- License: mit
- Created: 2019-09-21T18:57:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-31T05:33:44.000Z (5 months ago)
- Last Synced: 2024-10-14T14:10:37.388Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 349 KB
- Stars: 50
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Programmatically set environment variables for use in subsequent steps
- fucking-awesome-actions - Programmatically set environment variables for use in subsequent steps
- awesome-workflows - Programmatically set environment variables for use in subsequent steps
README
# set-env
Github action to set environment variables that can be globally accessed between steps.Example usage:-
```yaml
name: example-pipeline
on: [pull_request]jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- name: set environment variables
uses: allenevans/[email protected]
with:
MY_ENV_VAR: 'my value'- name: Printenv
run: |
echo "MY_ENV_VAR=${MY_ENV_VAR}"
printenv
```Notes:-
* You can set more than one variable at a time e.g.
```yaml
- name: set many environment variables
uses: allenevans/[email protected]
with:
VAR_A: abc
VAR_B: def
VAR_C: ghi
```
* Environment variable names are converted to UPPER_SNAKE_CASE by default e.g.
```yaml
myVar: abc => MYVAR=abc
with space: abc => WITH_SPACE=abc
```