https://github.com/somaz94/env-output-setter
env-output-setter
https://github.com/somaz94/env-output-setter
automation ci-cd devops environment-variables github-action github-actions github-output go json key-value workflow
Last synced: 14 days ago
JSON representation
env-output-setter
- Host: GitHub
- URL: https://github.com/somaz94/env-output-setter
- Owner: somaz94
- License: mit
- Created: 2024-11-06T03:35:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-26T07:23:04.000Z (22 days ago)
- Last Synced: 2026-03-27T02:36:10.592Z (21 days ago)
- Topics: automation, ci-cd, devops, environment-variables, github-action, github-actions, github-output, go, json, key-value, workflow
- Language: Go
- Homepage: https://github.com/marketplace/actions/environment-output-setter
- Size: 2.02 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# GitHub Environment/Output Setter
[](https://github.com/somaz94/container-action)


[](https://github.com/marketplace/actions/environment-output-setter)
## Overview
The **GitHub Environment/Output Setter** is a GitHub Action that allows you to set multiple key-value pairs in both `$GITHUB_ENV` and `$GITHUB_OUTPUT`. This action is useful for workflows that need to dynamically define environment variables or output values that other steps can reference.
## Quick Start
```yaml
- uses: somaz94/env-output-setter@v1
with:
env_key: 'GCP_REGION,AWS_REGION'
env_value: 'asia-northeast1,us-east-1'
output_key: 'GCP_OUTPUT,AWS_OUTPUT'
output_value: 'gcp_success,aws_success'
```
## Documentation
- [Usage Guide](docs/USAGE.md) - Comprehensive examples and common use cases
- [Features](docs/FEATURES.md) - Feature overview and advanced usage
- [JSON Support](docs/JSON_SUPPORT.md) - Working with JSON data structures
- [Troubleshooting](docs/TROUBLESHOOTING.md) - Common issues and solutions
- [API Reference](docs/API.md) - Complete inputs and outputs reference
## Key Features
- Set multiple environment variables and outputs in one step
- Value transformation (uppercase, lowercase, URL encoding)
- Mask sensitive values in logs
- JSON support for complex data structures
- Group related variables with prefixes
- Retry mechanism for file operations
- Debug mode for troubleshooting
## Basic Example
```yaml
- uses: somaz94/env-output-setter@v1
id: set_vars
with:
env_key: 'GCP_REGION,AWS_REGION'
env_value: 'asia-northeast1,us-east-1'
output_key: 'DEPLOY_STATUS'
output_value: 'success'
- name: Use variables
run: |
echo "GCP: ${{ env.GCP_REGION }}"
echo "AWS: ${{ env.AWS_REGION }}"
echo "Status: ${{ steps.set_vars.outputs.DEPLOY_STATUS }}"
```
For more examples, see the [Usage Guide](docs/USAGE.md).
## Development
```bash
make build # Build the binary
make test # Run unit tests with coverage
make test-local # Run local integration tests
make test-all # Run all tests
make cover # Generate coverage report
make cover-html # Open coverage in browser
make bench # Run benchmarks
make lint # Run go vet
make fmt # Format code
make clean # Remove build artifacts
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
For detailed information, please refer to the documentation in the [docs](docs/) folder.