Convert Environment File, Data or Keys, to or from, JSON Data or File.
Also allows masking the data as secret (only viable for source files since inputs are exposed).
Note
Please submit a Feature Request for new features or Open an Issue if you find any bugs.
| Input | Default | Description of Input |
|---|---|---|
| source-data | Required | Source Data or File Path |
| source-type | json |
Source Type: [json, env] |
| output-type | Opposite | Output Type: [json, env] |
| output-file | - | Optional File to Write Output Data |
| sensitive | false |
Mark Output Data as Sensitive |
| summary | true |
Add Summary to Job |
Source Environment or JSON Data or File Path.
Previously: source
Source Data Type,
one of: [json, env]
Previously: type
Output Data Type,defaults to the opposite of source-type,
one of: [json, env]
Previously: output
Optional File Path to Write the Output Data.
Previously: file
Set to true if data is sensitive and should be masked.
This will mask the data as a whole, plus every individual value.
Write a Summary for the job. To disable this set to false.
👀 View Example Summary
💾 ✔️ .github/test/results.json
Results
{ "VAR1": "success", "VAR2": "2" }Inputs
| Input | Value |
|---|---|
| source | .github/test/test.env |
| type | json |
| dest | .github/test/results.json |
| sensitive | false |
| summary | true |
To see a workflow run you can view a recent test.yaml run (requires login).
- name: 'Parse Environment'
uses: cssnr/env-json-action@master
with:
source-data: test.env| Output | Description |
|---|---|
| result | JSON or Environment Results |
- name: 'Parse Environment'
id: parse
uses: cssnr/env-json-action@master
with:
source-data: test.env
- name: 'Echo Result'
run: echo '${{ steps.parse.outputs.result }}'There are some more examples in the test workflow: .github/workflows/test.yaml
For more examples, you can check out other projects using this action:
https://github.com/cssnr/env-json-action/network/dependents
The following rolling tags are maintained.
| Version Tag | Rolling | Bugs | Feat. | Name | Target | Example |
|---|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | Major | vN.x.x |
vN |
|
| ✅ | ✅ | ❌ | Minor | vN.N.x |
vN.N |
|
| ❌ | ❌ | ❌ | Micro | vN.N.N |
vN.N.N |
You can view the release notes for each version on the releases page.
The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.
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-requests
If 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/
For more information, see the CSSNR SUPPORT.md.
Please consider making a donation to support the development of this project and additional open source projects.
If you would like to submit a PR, please review the CONTRIBUTING.md.
Additionally, you can support other GitHub Actions I have published:
- Stack Deploy Action
- Portainer Stack Deploy Action
- Docker Context Action
- VirusTotal Action
- Mirror Repository Action
- Update Version Tags Action
- Docker Tags Action
- Update JSON Value Action
- JSON Key Value Check Action
- Parse Issue Form Action
- Cloudflare Purge Cache Action
- Mozilla Addon Update Action
- Package Changelog Action
- NPM Outdated Check Action
- Label Creator Action
- Algolia Crawler Action
- Upload Release Action
- Check Build Action
- Web Request Action
- Get Commit Action
❔ Unpublished Actions
These actions are not published on the Marketplace, but may be useful.
- cssnr/draft-release-action - Keep a draft release ready to publish.
- cssnr/env-json-action - Convert env file to json or vice versa.
- cssnr/push-artifacts-action - Sync files to a remote host with rsync.
- smashedr/update-release-notes-action - Update release notes.
- smashedr/combine-release-notes-action - Combine release notes.
📝 Template Actions
These are basic action templates that I use for creating new actions.
- js-test-action - JavaScript
- py-test-action - Python
- ts-test-action - TypeScript
- docker-test-action - Docker Image
Note: The docker-test-action builds, runs and pushes images to GitHub Container Registry.
For a full list of current projects visit: https://cssnr.github.io/