Skip to content

Commit a2313b4

Browse files
committed
fix(workflow): fix malformed fromJSON expressions blocking translate-docs dispatch
Three suffix expressions `fromJSON('["']')[0]` in the Slack notification payload were syntactically invalid — the single-quoted string closed early, leaving `]` as an unexpected token. GitHub Actions rejected these expressions at run time, preventing the workflow from starting even via workflow_dispatch. Also gate the failure count values with the same condition as their prefix labels so blank lines / stray zeros don't appear in Slack when there are no failures.
1 parent 889e497 commit a2313b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/translate-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ jobs:
337337
• Updated translations: ${{ steps.parse_summary.outputs.updated_translations }}
338338
• Skipped: ${{ steps.parse_summary.outputs.skipped_translations }}
339339
${{ steps.parse_summary.outputs.has_failures == 'true' && '*Failures:*' || '' }}
340-
${{ steps.parse_summary.outputs.failed_translations != '0' && fromJSON('[" • Doc translation failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.failed_translations }}${{ steps.parse_summary.outputs.failed_translations != '0' && fromJSON('["']')[0] || '' }}
341-
${{ steps.parse_summary.outputs.code_json_failures != '0' && fromJSON('[" • Code.json failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.code_json_failures }}${{ steps.parse_summary.outputs.code_json_failures != '0' && fromJSON('["']')[0] || '' }}
342-
${{ steps.parse_summary.outputs.theme_failures != '0' && fromJSON('[" • Theme (navbar/footer) failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.theme_failures }}${{ steps.parse_summary.outputs.theme_failures != '0' && fromJSON('["']')[0] || '' }}
340+
${{ steps.parse_summary.outputs.failed_translations != '0' && fromJSON('[" • Doc translation failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.failed_translations != '0' && steps.parse_summary.outputs.failed_translations || '' }}
341+
${{ steps.parse_summary.outputs.code_json_failures != '0' && fromJSON('[" • Code.json failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.code_json_failures != '0' && steps.parse_summary.outputs.code_json_failures || '' }}
342+
${{ steps.parse_summary.outputs.theme_failures != '0' && fromJSON('[" • Theme (navbar/footer) failures: "]')[0] || '' }}${{ steps.parse_summary.outputs.theme_failures != '0' && steps.parse_summary.outputs.theme_failures || '' }}
343343
- type: "section"
344344
text:
345345
type: "mrkdwn"

0 commit comments

Comments
 (0)