From 9ec74c59da6d75723bc75db4983eb7e55d0944b4 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Mon, 20 Nov 2023 22:52:28 +0700 Subject: [PATCH] docs: clarify composite readme (#4) * docs: swap python readme with action * docs: add contributing to composite readme * docs: update action name * docs: clarify python readme --- README.md | 49 ++++++++++++++++++++++++++++++------------------ README_PYTHON.md | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 README_PYTHON.md diff --git a/README.md b/README.md index 8ca08ed..7950070 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ -# `> Nested JSON Postprocessor` +# GitHub Action `> Nested JSON Postprocessor` Remove null or empty keys, list and array from JSON files. +## `> Postprocessor // Usage` + +Before you start, make sure that you have setup the supported version of Python in your workflow: + | Python version | Support status | | -------------- | ---------------- | | Upcoming | ⚙️ Best effort | @@ -13,23 +17,32 @@ Remove null or empty keys, list and array from JSON files. | 3.7 | ⚙️ Best effort | | =<3.6 | ❌ Not Supported | -## `> Postprocessor // Usage` - -> [!IMPORTANT] -> This guide assume that you already installed Python 3.10 or higher - -### `> Postprocessor // Preparing the files` - -1. Clone the repository: `git@github.com:validcube/crowdin-nested-json-postprocessor.git` -2. Create two new folder called: `input` and `output` -3. Copy the JSON files that you want to process into the `input` folder - -### `> Postprocessor // Running the script` - -Running the script: - -1. Install the required dependencies: `pip3 install -r requirements.txt` -2. Run the script: `python3 main.py` +```yml + - name: Set up Python 3.12 + uses: actions/setup-python@v4 + with: + python-version: 3.12 +``` + +| Input | Required | Description | +| ---------------------- | ----------------------------------- | ------------------ | +| `source_dir` | ✅ Yes | Input directory | +| `destination_dir` | ❌ No (default to `source_dir`) | Output directory | +| `signing_key` | ❌ No | Signing key | +| `commit_message` | ❌ No (default to `JSON Cleanup`) | Commit message | +| `secrets.GITHUB_TOKEN` | ❌ No (default to GitHub's default) | GitHub's PAT token | + +```yml + - name: Nested JSON Postprocessor + uses: validcube/crowdin-nested-json-postprocessor@v0.1 + with: + source_dir: 'path/to/your/source/directory' # required, your input directory + destination_dir: 'path/to/your/destination/directory' # optional, default to source_dir + signing_key: 'your-signing-key' # optional, will skip signing if not provided + commit_message: 'your-custom-commit-message' # optional, default to "JSON Cleanup" + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # optional, default to GitHub's default +``` ## `> Postprocessor // Contributing` diff --git a/README_PYTHON.md b/README_PYTHON.md new file mode 100644 index 0000000..dfe940f --- /dev/null +++ b/README_PYTHON.md @@ -0,0 +1,36 @@ +# Python `> Nested JSON Postprocessor` + +Remove null or empty keys, list and array from JSON files. + +| Python version | Support status | +| -------------- | ---------------- | +| Upcoming | ⚙️ Best effort | +| 3.12 | ✅ Supported | +| 3.11 | ✅ Supported | +| 3.10 | ✅ Supported | +| 3.9 | ✅ Supported | +| 3.8 | ⚙️ Best effort | +| 3.7 | ⚙️ Best effort | +| =<3.6 | ❌ Not Supported | + +## `> Postprocessor // Usage` + +> [!IMPORTANT] +> This guide assume that you already installed Python 3.10 or higher + +### `> Postprocessor // Preparing the files` + +1. Clone the repository: `git@github.com:validcube/crowdin-nested-json-postprocessor.git` +2. Create two new folder called: `input` and `output` +3. Copy the JSON files that you want to process into the `input` folder + +### `> Postprocessor // Running the script` + +Running the script: + +1. Install the required dependencies: `pip3 install -r requirements.txt` +2. Run the script: `python3 main.py` + +## `> Postprocessor // Contributing` + +Consider checking out the [CONTRIBUTING.md](CONTRIBUTING.md) page.