File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,10 @@ You can also run any other Crowdin CLI command by specifying the `command` and `
216216 with:
217217 command: 'pre-translate'
218218 command_args: '-l uk --method tm --branch main'
219+
220+ # Access the command output in subsequent steps (optional)
221+ - name: Use command output
222+ run: echo "${{ steps.crowdin.outputs.command_output }}"
219223` ` `
220224
221225To 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:
227231- `pull_request_url` : The URL of the pull request created by the workflow
228232- `pull_request_number` : The number of the pull request created by the workflow
229233- `pull_request_created` : Whether a new pull request was created (`true`) or an existing one was found (`false`)
234+ - `command_output` : The output of the Crowdin CLI command (only available when using the `command` input)
230235
231236# # Permissions
232237
Original file line number Diff line number Diff line change @@ -193,6 +193,8 @@ outputs:
193193 description : ' The number of the pull request created by the workflow'
194194 pull_request_created :
195195 description : ' Whether a new pull request was created (true) or an existing one was found (false)'
196+ command_output :
197+ description : ' The output of the Crowdin CLI command when using the command input'
196198
197199runs :
198200 using : docker
Original file line number Diff line number Diff line change 44echo " pull_request_url=" >> $GITHUB_OUTPUT
55echo " pull_request_number=" >> $GITHUB_OUTPUT
66echo " pull_request_created=false" >> $GITHUB_OUTPUT
7+ echo " command_output=" >> $GITHUB_OUTPUT
78
89if [ " $INPUT_DEBUG_MODE " = true ] || [ -n " $RUNNER_DEBUG " ]; then
910 echo ' ---------------------------'
364365
365366if [ -n " $INPUT_COMMAND " ]; then
366367 echo " RUNNING COMMAND crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS "
367- crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS
368+
369+ # Capture command output while still displaying it
370+ CROWDIN_OUTPUT=$( crowdin $INPUT_COMMAND $INPUT_COMMAND_ARGS )
371+ echo " $CROWDIN_OUTPUT "
372+
373+ # Write multiline output to GITHUB_OUTPUT using heredoc delimiter
374+ echo " command_output<<CROWDIN_EOF" >> $GITHUB_OUTPUT
375+ echo " $CROWDIN_OUTPUT " >> $GITHUB_OUTPUT
376+ echo " CROWDIN_EOF" >> $GITHUB_OUTPUT
368377
369378 # in this case, we don't need to continue executing any further default behavior
370379 exit 0
You can’t perform that action at this time.
0 commit comments