https://github.com/cssnr/env-json-action
Convert Environment File to/from a JSON File
https://github.com/cssnr/env-json-action
actions
Last synced: 5 months ago
JSON representation
Convert Environment File to/from a JSON File
- Host: GitHub
- URL: https://github.com/cssnr/env-json-action
- Owner: cssnr
- License: gpl-3.0
- Created: 2024-08-07T00:42:43.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-02-19T08:24:28.000Z (5 months ago)
- Last Synced: 2025-02-19T08:31:16.240Z (5 months ago)
- Topics: actions
- Language: JavaScript
- Homepage: https://cssnr.github.io
- Size: 298 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/cssnr/env-json-action/actions/workflows/release.yaml)
[](https://github.com/cssnr/env-json-action/actions/workflows/test.yaml)
[](https://sonarcloud.io/summary/new_code?id=cssnr_env-json-action)
[](https://github.com/cssnr/env-json-action/releases/latest)
[](https://github.com/cssnr/env-json-action/graphs/commit-activity)
[](https://codeberg.org/cssnr/env-json-action)
[](https://github.com/cssnr/env-json-action)
[](https://cssnr.github.io/)
[](https://discord.gg/wXy6m2X8wY)# Environment to or from JSON Action
- [Inputs](#Inputs)
- [Outputs](#Outputs)
- [Examples](#Examples)
- [Support](#Support)
- [Contributing](#Contributing)Convert an Environment File to or from JSON for Outputs or Writing to a File.
> [!NOTE]
> Please submit
> a [Feature Request](https://github.com/cssnr/env-json-action/discussions/categories/feature-requests)
> for new features or [Open an Issue](https://github.com/cssnr/env-json-action/issues) if you find any bugs.## Inputs
| input | required | default | description |
| --------- | -------- | ------- | ------------------------------------ |
| source | Yes | - | Source Environment or JSON File Path |
| type | No | `json` | Output Type: [json, env] \* |
| dest | No | - | Optional File to Write Data Too |
| sensitive | No | `false` | Sensitive Data \* |
| summary | No | `true` | Add Summary to Job \* |**type** - By default this converts env to json. To perform json to env, use type `env`.
**sensitive** - Set to `true` if data is sensitive and should be masked.
**summary** - Write a Summary for the job. To disable this set to `false`.
📜 View Example Summary
---
💾 ✔️ `.github/test/results.json`
Results
```json
{ "VAR1": "success", "VAR2": "2" }
```InputsInputValuesource
.github/test/test.env
typejson
dest.github/test/results.json
sensitivefalse
summarytrue
---
```yaml
- name: 'Parse Environment'
uses: cssnr/env-json-action@master
with:
source: test.env
```## Outputs
| output | description |
| ------ | --------------------------- |
| result | JSON or Environment Results |```yaml
- name: 'Parse Environment'
id: parse
uses: cssnr/env-json-action@master
with:
source: test.env- name: 'Echo Result'
run: echo '${{ steps.parse.outputs.result }}'
```## Examples
There are some more examples in the test workflow: [.github/workflows/test.yaml](.github/workflows/test.yaml)
For a full deploy workflow example, see:
https://github.com/cssnr/django5-boiler/blob/master/.github/workflows/deploy.yaml# Support
For general help or to request a feature, see:
- Q&A Discussion: https://github.com/cssnr/env-json-action/discussions/categories/q-a
- Request a Feature: https://github.com/cssnr/env-json-action/discussions/categories/feature-requestsIf you are experiencing an issue/bug or getting unexpected results, you can:
- Report an Issue: https://github.com/cssnr/env-json-action/issues
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
- Provide General
Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback/?app=Env%20JSON%20Action)# Contributing
Currently, the best way to contribute to this project is to star this project on GitHub.
Additionally, you can support other GitHub Actions I have published:
- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action?tab=readme-ov-file#readme)
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#readme)
- [VirusTotal Action](https://github.com/cssnr/virustotal-action?tab=readme-ov-file#readme)
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action?tab=readme-ov-file#readme)
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action?tab=readme-ov-file#readme)
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action?tab=readme-ov-file#readme)
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action?tab=readme-ov-file#readme)
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action?tab=readme-ov-file#readme)
- [Cloudflare Purge Cache Action](https://github.com/cssnr/cloudflare-purge-cache-action?tab=readme-ov-file#readme)For a full list of current projects to support visit: [https://cssnr.github.io/](https://cssnr.github.io/)