@@ -13,7 +13,8 @@ import {MANIFEST_JOB_IDS} from './ci-gates.js'
1313// (up to the next top-level key) and allow a trailing comment after the id. Job
1414// keys are always bare (their mapping is on following lines), so nested keys —
1515// indented deeper than 2 spaces — and `key: value` anchors are naturally excluded.
16- export function parseJobIds ( workflow ) {
16+ export function parseJobIds ( workflowText ) {
17+ const workflow = workflowText . replace ( / \r \n / g, '\n' )
1718 const jobsAt = workflow . search ( / ^ j o b s : / m)
1819 if ( jobsAt === - 1 ) return [ ]
1920 const afterHeader = workflow . slice ( jobsAt ) . replace ( / ^ j o b s : .* \n / , '' )
@@ -24,9 +25,13 @@ export function parseJobIds(workflow) {
2425
2526// Pure and testable: given the two YAML texts and the manifest job ids, return the
2627// list of human-readable problems (empty when everything is in sync).
27- export function findProblems ( { workflow, devYml, manifestJobIds} ) {
28+ export function findProblems ( { workflow : workflowText , devYml : devYmlText , manifestJobIds} ) {
2829 const problems = [ ]
2930
31+ // Normalize line endings so the parsing below is robust to CRLF working trees.
32+ const workflow = workflowText . replace ( / \r \n / g, '\n' )
33+ const devYml = devYmlText . replace ( / \r \n / g, '\n' )
34+
3035 const workflowJobIds = parseJobIds ( workflow )
3136 const manifestSet = new Set ( manifestJobIds )
3237 const workflowSet = new Set ( workflowJobIds )
0 commit comments