Skip to content

Commit cc0ac77

Browse files
committed
fix(issues): run validate after translate for area heuristics
Add needs: translate so area labeling can read the inline English translation block on the same issue event, while still running validate when translate is skipped or fails.
1 parent 5f5b2c4 commit cc0ac77

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/enforce-issue-quality.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,17 @@ jobs:
695695
}
696696
697697
validate:
698+
# Wait for translate so area heuristics can read the inline English block
699+
# when translation wrote one. Still run if translate was skipped or failed —
700+
# quality closure must not depend on translation success.
701+
needs: translate
698702
if: >
699-
github.event_name == 'issues' ||
700-
(github.event_name == 'workflow_dispatch' &&
701-
inputs.backfill_open_areas != true &&
702-
inputs.issue_number != '')
703+
always() &&
704+
needs.translate.result != 'cancelled' &&
705+
(github.event_name == 'issues' ||
706+
(github.event_name == 'workflow_dispatch' &&
707+
inputs.backfill_open_areas != true &&
708+
inputs.issue_number != ''))
703709
runs-on: ubuntu-latest
704710
permissions:
705711
contents: read

tests/ci-workflows.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ describe("GitHub Actions hardening", () => {
19831983
/translate:\s*\n\s*name: Translate non-English issues\s*\n\s*if: >\s*\n\s*github\.event_name == 'issues' \|\|\s*\n\s*\(github\.event_name == 'workflow_dispatch' &&\s*\n\s*inputs\.backfill_open_areas != true &&\s*\n\s*inputs\.issue_number != ''\)/,
19841984
);
19851985
expect(workflow).toMatch(
1986-
/validate:\s*\n\s*if: >\s*\n\s*github\.event_name == 'issues' \|\|\s*\n\s*\(github\.event_name == 'workflow_dispatch' &&\s*\n\s*inputs\.backfill_open_areas != true &&\s*\n\s*inputs\.issue_number != ''\)/,
1986+
/validate:\s*\n\s*# Wait for translate[\s\S]*?\n\s*needs: translate\s*\n\s*if: >\s*\n\s*always\(\) &&\s*\n\s*needs\.translate\.result != 'cancelled' &&\s*\n\s*\(github\.event_name == 'issues' \|\|\s*\n\s*\(github\.event_name == 'workflow_dispatch' &&\s*\n\s*inputs\.backfill_open_areas != true &&\s*\n\s*inputs\.issue_number != ''\)\)/,
19871987
);
19881988

19891989
const commentJob = workflow.split(/\n {2}translate-comment:\n/)[1]!.split(/\n {2}[a-zA-Z]/)[0]!;

0 commit comments

Comments
 (0)