Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simenandre/branch-environment-action
☀️ Get your a environment variable based on branch
https://github.com/simenandre/branch-environment-action
action actions github-actions
Last synced: 24 days ago
JSON representation
☀️ Get your a environment variable based on branch
- Host: GitHub
- URL: https://github.com/simenandre/branch-environment-action
- Owner: simenandre
- License: mit
- Created: 2020-06-07T12:20:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-26T23:49:26.000Z (7 months ago)
- Last Synced: 2024-05-28T17:14:33.767Z (6 months ago)
- Topics: action, actions, github-actions
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Branch-based Environment Variable Action
This Github Actions parses environment variables into one variable based on what branch the workflow is running on.
## Usage
```yaml
jobs:
up:
name: Important Stuff
runs-on: ubuntu-latest
steps:
...
- uses: cobraz/branch-environment-action@master
with:
name: MASTER_KEY
env:
DEVELOP_MASTER_KEY: ${{ secrets.DEVELOP_MASTER_KEY }}
MASTER_MASTER_KEY: ${{ secrets.MASTER_MASTER_KEY }}
NEXT_MASTER_KEY: ${{ secrets.NEXT_MASTER_KEY }}
- run: ./do-something-important $MASTER_KEY
...
```PS: The branch name will be _uppercased_ eg. `master` will be transformed to `MASTER`.