Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yumemi-inc/environment-variables-action
Fetch environment variables without creating deployments.
https://github.com/yumemi-inc/environment-variables-action
continuous-deployment environments github-action
Last synced: 9 days ago
JSON representation
Fetch environment variables without creating deployments.
- Host: GitHub
- URL: https://github.com/yumemi-inc/environment-variables-action
- Owner: yumemi-inc
- License: mit
- Created: 2023-05-24T12:28:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-18T04:03:51.000Z (8 months ago)
- Last Synced: 2024-12-08T17:41:46.361Z (15 days ago)
- Topics: continuous-deployment, environments, github-action
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/environment-variables-action
- Size: 930 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Environment Variables Action
> [!WARNING]
> This is not an official product of YUMEMI Inc.Fetch environment variables without creating deployments.
## Why?
We can adopt [Environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)
in cases of deployments using GitHub Actions. However, we sometimes need to use environment variables **before** the
deployment. Let's say you are applying Terraform stack via Actions. You don't need approval for the deployment in planning,
but running plan usually requires environment variables.Using this action, you can use the environment variables from the workflow runs that is not attached to any environments.
Thus you can defer approval after planning, before applying your stack.## Getting Started
### Prerequisites
- GitHub PAT (Supports fine-graded tokens)
- As you know we usually can `${{ github.token }}` instead, but in this case we can not use it since the token does
not support `environments:read` scope.```yaml
name: Terraformon:
push:
branches:
- mainjobs:
plan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3- id: env
uses: yumemi-inc/environment-variables-action@v1
with:
environment: staging
token: '${{ secrets.FETCH_ENVIRONMENTS_TOKEN }}'- run: terraform plan
env:
AWS_PROFILE: '${{ steps.env.outputs.AWS_PROFILE }}'
```