remoteintech/remote-jobs · error
Slug "${data.slug}" does not match filename "${basename(file
Error message
Slug "${data.slug}" does not match filename "${basename(filePath)}". The slug must be "${expectedSlug}". What it means
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.
Source
Thrown at .github/scripts/validate-companies.js:149
}
// Validate technologies array
if (data.technologies && Array.isArray(data.technologies)) {
for (const tech of data.technologies) {
if (!VALID_TECHNOLOGIES.includes(tech)) {
errors.push(
`Invalid technology tag: "${tech}". Valid tags: ${VALID_TECHNOLOGIES.join(", ")}`
);
}
}
}
// Validate slug matches filename
if (data.slug) {
const expectedSlug = basename(filePath, ".md");
if (data.slug !== expectedSlug) {
errors.push(
`Slug "${data.slug}" does not match filename "${basename(filePath)}". The slug must be "${expectedSlug}".`
);
}
}
// Validate URL format
if (data.website && !isValidUrl(data.website)) {
errors.push(
`Invalid \`website\` URL: "${data.website}". Must be a full URL starting with https:// or http://`
);
}
if (data.careers_url && !isValidUrl(data.careers_url)) {
errors.push(
`Invalid \`careers_url\`: "${data.careers_url}". Must be a full URL starting with https:// or http://`
);
}
// Check required markdown sectionsView on GitHub (pinned to b1dd8deb19)
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.
Example fix
// file: src/companies/acme-corp.md // before slug: acme // after slug: acme-corp
Defensive patterns
Strategy: validation
Validate before calling
import { basename } from 'node:path';
function slugMatchesFilename(filePath, slug) {
return slug === basename(filePath, '.md');
} Type guard
function slugMatches(filePath, slug) {
return typeof slug === 'string' && slug === basename(filePath, '.md');
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Missing YAML frontmatter. The file must start with `---` fol
- Missing required field: `${field}`
- Invalid `region`: "${data.region}". Must be one of: ${VALID_
- Invalid `remote_policy`: "${data.remote_policy}". Must be on
- Invalid `company_size`: "${data.company_size}". Must be one
AI-assisted analysis of remoteintech/remote-jobs@b1dd8deb19 (2026-08-13).
Data as JSON: /api/errors/a158adce13860670.
Report an issue: GitHub.