From eab102d8ee551a958038ade503071a502e3f0f76 Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Tue, 13 Jan 2026 17:56:08 +0200 Subject: [PATCH 1/2] feat: add command_output for arbitrary CLI commands Capture and expose the output of Crowdin CLI commands when using the `command` input, allowing users to access it in subsequent workflow steps via `steps..outputs.command_output`. Closes #299 --- README.md | 5 +++++ action.yml | 2 ++ entrypoint.sh | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8010c6..69225c1 100644 --- a/README.md +++ b/README.md @@ -216,6 +216,10 @@ You can also run any other Crowdin CLI command by specifying the `command` and ` with: command: 'pre-translate' command_args: '-l uk --method tm --branch main' + + # Access the command output in subsequent steps (optional) + - name: Use command output + run: echo "${{ steps.crowdin.outputs.command_output }}" ``` To see the full list of available commands, visit the [official documentation](https://crowdin.github.io/crowdin-cli/). @@ -227,6 +231,7 @@ This action has the following outputs: - `pull_request_url`: The URL of the pull request created by the workflow - `pull_request_number`: The number of the pull request created by the workflow - `pull_request_created`: Whether a new pull request was created (`true`) or an existing one was found (`false`) +- `command_output`: The output of the Crowdin CLI command (only available when using the `command` input) ## Permissions diff --git a/action.yml b/action.yml index f74cfd7..9f4bc15 100644 --- a/action.yml +++ b/action.yml @@ -193,6 +193,8 @@ outputs: description: 'The number of the pull request created by the workflow' pull_request_created: description: 'Whether a new pull request was created (true) or an existing one was found (false)' + command_output: + description: 'The output of the Crowdin CLI command when using the command input' runs: using: docker diff --git a/entrypoint.sh b/entrypoint.sh index 36ce8b9..e8734b3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,6 +4,7 @@ echo "pull_request_url=" >> $GITHUB_OUTPUT echo "pull_request_number=" >> $GITHUB_OUTPUT echo "pull_request_created=false" >> $GITHUB_OUTPUT +echo "command_output=" >> $GITHUB_OUTPUT if [ "$INPUT_DEBUG_MODE" = true ] || [ -n "$RUNNER_DEBUG" ]; then echo '---------------------------' @@ -364,7 +365,15 @@ fi if [ -n "$INPUT_COMMAND" ]; then echo "RUNNING COMMAND crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS" - crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS + + # Capture command output while still displaying it + CROWDIN_OUTPUT=$(crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS) + echo "$CROWDIN_OUTPUT" + + # Write multiline output to GITHUB_OUTPUT using heredoc delimiter + echo "command_output<> $GITHUB_OUTPUT + echo "$CROWDIN_OUTPUT" >> $GITHUB_OUTPUT + echo "CROWDIN_EOF" >> $GITHUB_OUTPUT # in this case, we don't need to continue executing any further default behavior exit 0 From cb33da8eec4430d2d9cf941f38be78aa27beef21 Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Tue, 13 Jan 2026 18:09:30 +0200 Subject: [PATCH 2/2] fix --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 69225c1..b865bd1 100644 --- a/README.md +++ b/README.md @@ -217,9 +217,9 @@ You can also run any other Crowdin CLI command by specifying the `command` and ` command: 'pre-translate' command_args: '-l uk --method tm --branch main' - # Access the command output in subsequent steps (optional) - - name: Use command output - run: echo "${{ steps.crowdin.outputs.command_output }}" +# Access the command output in subsequent steps (optional) +- name: Use command output + run: echo "${{ steps.crowdin.outputs.command_output }}" ``` To see the full list of available commands, visit the [official documentation](https://crowdin.github.io/crowdin-cli/).