https://github.com/levonet/action-config-blanks
Creates files and directories using the JSON template
https://github.com/levonet/action-config-blanks
Last synced: 11 months ago
JSON representation
Creates files and directories using the JSON template
- Host: GitHub
- URL: https://github.com/levonet/action-config-blanks
- Owner: levonet
- License: mit
- Created: 2021-06-15T14:54:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T11:12:58.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T23:04:22.465Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action: Config Blanks
This action helps create dynamic configuration files during workflow.
JSON in key-value format is passed to the action input.
The key is the path to the file or directory.
The value can be both text and object.
An object in value is only supported for file formats such as YAML and JSON.
To create a file in YAML format, the file must have the extension `.yml` or `.yaml`.
Under other conditions, a JSON file is created from the object or list.
If the content is `null`, the file is not created.
To create a directory, the key must end with a slash. And content is not taken into account.
```yml
- uses: blablacar/action-config-blanks@master
with:
source: '{"a/b.txt":"a\nb","c/d.yml":{"a":{"b":"text"}},".tmp/":null}'
# Create:
# a/b.txt with plain text content
# c/d.yml in YAML format
# .tmp directory
```
## Inputs
### `source`
**Required** A JSON key-value object.
Where as the key is the file or directory name, and the value as the content of the file.
The name of the directory must end in a slash (content value is ignored).
If the content is `null`, the file is not created.
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)