{"record":{"id":"a158adce13860670","repo":"remoteintech/remote-jobs","slug":"slug-data-slug-does-not-match-filename-bas","errorCode":null,"errorMessage":"Slug \"${data.slug}\" does not match filename \"${basename(filePath)}\". The slug must be \"${expectedSlug}\".","messagePattern":"Slug \"(.+?)\" does not match filename \"(.+?)\"\\. The slug must be \"(.+?)\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":".github/scripts/validate-companies.js","lineNumber":149,"sourceCode":"  }\n\n  // Validate technologies array\n  if (data.technologies && Array.isArray(data.technologies)) {\n    for (const tech of data.technologies) {\n      if (!VALID_TECHNOLOGIES.includes(tech)) {\n        errors.push(\n          `Invalid technology tag: \"${tech}\". Valid tags: ${VALID_TECHNOLOGIES.join(\", \")}`\n        );\n      }\n    }\n  }\n\n  // Validate slug matches filename\n  if (data.slug) {\n    const expectedSlug = basename(filePath, \".md\");\n    if (data.slug !== expectedSlug) {\n      errors.push(\n        `Slug \"${data.slug}\" does not match filename \"${basename(filePath)}\". The slug must be \"${expectedSlug}\".`\n      );\n    }\n  }\n\n  // Validate URL format\n  if (data.website && !isValidUrl(data.website)) {\n    errors.push(\n      `Invalid \\`website\\` URL: \"${data.website}\". Must be a full URL starting with https:// or http://`\n    );\n  }\n\n  if (data.careers_url && !isValidUrl(data.careers_url)) {\n    errors.push(\n      `Invalid \\`careers_url\\`: \"${data.careers_url}\". Must be a full URL starting with https:// or http://`\n    );\n  }\n\n  // Check required markdown sections","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/remoteintech/remote-jobs/blob/b1dd8deb1945e5ff58f9e9c35e318f53c8871930/.github/scripts/validate-companies.js#L131-L167","documentation":"Slug/filename consistency check at lines 145-152. If data.slug exists, basename(filePath, '.md') is computed and compared for strict equality. The slug must equal the filename minus extension. basename runs on the actual path passed in, so a `pr-head/` prefix from a pull_request_target checkout (which is preserved in `actual` at line 225) doesn't affect the comparison — only the trailing filename matters.","triggerScenarios":"File was renamed via git mv but the slug field wasn't updated; contributor's filename uses kebab-case-different from the slug; casing mismatch on case-sensitive filesystems; the slug has a trailing/leading hyphen that the filename doesn't.","commonSituations":"Company rebrand requiring a rename; contributor copies another file and changes only one of {filename, slug}; CI on Linux rejects a casing that passed on macOS dev.","solutions":["Set the slug field to exactly the filename without `.md`.","Or rename the file to match the desired slug, then update the field to match.","Re-run the validator to confirm."],"exampleFix":"// file: src/companies/acme-corp.md\n// before\nslug: acme\n// after\nslug: acme-corp","handlingStrategy":"validation","validationCode":"import { basename } from 'node:path';\nfunction slugMatchesFilename(filePath, slug) {\n  return slug === basename(filePath, '.md');\n}","typeGuard":"function slugMatches(filePath, slug) {\n  return typeof slug === 'string' && slug === basename(filePath, '.md');\n}","tryCatchPattern":null,"preventionTips":["When renaming a company file with git mv, update the slug field in the same commit.","Pick the canonical slug once and use it as both filename and frontmatter value.","Beware casing differences between macOS dev and Linux CI."],"tags":["slug","filename","frontmatter","consistency"],"backgroundTag":null,"analyzedSha":"b1dd8deb1945e5ff58f9e9c35e318f53c8871930","analyzedAt":"2026-08-13T04:09:00.804Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}