Skip to content

Commit 57c82e3

Browse files
committed
add comments, update post-run
1 parent 12c2289 commit 57c82e3

19 files changed

+296
-133
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ additional_params: >
139139
140140
- `post_process_command` — A shell command that runs after pulling translation files from Lokalise but before committing them. This allows you to perform custom transformations, cleanup, replacements, or validations on the downloaded files. The command is executed in the root of your repository and has access to several environment variables (`TRANSLATIONS_PATH`, `BASE_LANG`, `FILE_FORMAT`, `FILE_EXT`, `FLAT_NAMING`, `PLATFORM`).
141141
+ Please note that this is an **experimental feature**. You are fully responsible for the logic and behavior of any script executed through this option. These scripts run in your own repository context, under your control. If something breaks or behaves unexpectedly, we cannot guarantee support or ensure the security of the code being executed.
142+
+ This is executed inside a Bash shell (`shell: bash`) therefore your command must be runnable from Bash. If you need a different interpreter or shell, call it explicitly, for example `post_process_command: "zsh -c 'source ~/.zshrc && run_my_script'"`.
142143
+ If your command requires a custom interpreter (e.g. running tools that are not available by default on GitHub-hosted runners), you are responsible for setting it up yourself before the command is executed.
143144

144145
```yaml

action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,20 @@ runs:
244244
FLAT_NAMING: "${{ inputs.flat_naming }}"
245245
PLATFORM: "${{ inputs.os_platform }}"
246246
STRICT: "${{ inputs.post_process_strict }}"
247+
POST_CMD: "${{ inputs.post_process_command }}"
247248
shell: bash
248249
run: |
249250
echo "Running post-process command:"
250-
echo "${{ inputs.post_process_command }}"
251-
251+
printf '%s\n' "$POST_CMD"
252+
252253
set +e
253-
eval "${{ inputs.post_process_command }}"
254+
bash -eo pipefail -lc "$POST_CMD"
254255
EXIT_CODE=$?
255256
set -e
256257
257258
if [[ "$STRICT" == "true" && "$EXIT_CODE" -ne 0 ]]; then
258259
echo "Post-processing failed with exit code $EXIT_CODE and strict mode is enabled. Exiting."
259-
exit $EXIT_CODE
260+
exit "$EXIT_CODE"
260261
elif [[ "$EXIT_CODE" -ne 0 ]]; then
261262
echo "Post-processing failed with exit code $EXIT_CODE, but strict mode is off. Continuing..."
262263
else

bin/commit_changes_linux_amd64

104 Bytes
Binary file not shown.

bin/commit_changes_linux_arm64

64 Bytes
Binary file not shown.

bin/commit_changes_mac_amd64

0 Bytes
Binary file not shown.

bin/commit_changes_mac_arm64

0 Bytes
Binary file not shown.
-120 Bytes
Binary file not shown.
184 Bytes
Binary file not shown.

bin/detect_changed_files_mac_amd64

0 Bytes
Binary file not shown.

bin/detect_changed_files_mac_arm64

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)