Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
fix: expose input field for the GitHub Token (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ushie authored Dec 1, 2023
1 parent 6b39e39 commit c4ba22d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,29 @@ Before you start, make sure that you have setup the supported version of Python
| =<3.6 | ❌ Not Supported |

```yml
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- 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 |
| Input | Required | Description |
| ----------------- | --------------------------------- | ------------------------------ |
| `token` | ✅ Yes | GitHub's Personal Access Token |
| `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 |

```yml
- name: Nested JSON Postprocessor
uses: validcube/[email protected]
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
- name: Nested JSON Postprocessor
uses: validcube/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }} # required, GitHub's Personal Access Token
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"
```

## `> Postprocessor // Contributing`
Expand Down
39 changes: 19 additions & 20 deletions README_ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,27 @@ Before you start, make sure that you have setup the supported version of Python
| =<3.6 | ❌ Not Supported |

```yml
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- 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 |
| Input | Required | Description |
| ----------------- | --------------------------------- | ------------------------------ |
| `token` | ✅ Yes | GitHub's Personal Access Token |
| `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 |

```yml
- name: Nested JSON Postprocessor
uses: ./.github/actions/python-action ???? # Soon:tm:
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
- name: Nested JSON Postprocessor
uses: ./.github/actions/python-action ???? # Soon:tm:
with:
token: ${{ secrets.GITHUB_TOKEN }} # required, GitHub's Personal Access Token
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"
```
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Crowdin Nested JSON Postprocessor"
description: "Runs a Python script that remove empty string in JSON caused by Crowdin not respecting skip untranslated strings"

inputs:
token:
description: "GitHub's Personal Access Token"
required: true
source_dir:
description: "The source directory to copy"
required: true
Expand Down Expand Up @@ -49,7 +52,7 @@ runs:
else
COMMIT_OPTIONS=""
fi
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
echo "${{ inputs.token }}" | gh auth login --with-token
git add .
git commit $COMMIT_OPTIONS -m ${{ inputs.commit_message }}
git push
Expand Down

0 comments on commit c4ba22d

Please sign in to comment.