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 sections

View on GitHub (pinned to b1dd8deb19)

Solutions

  1. Set the slug field to exactly the filename without `.md`.
  2. Or rename the file to match the desired slug, then update the field to match.
  3. 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 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


AI-assisted analysis of remoteintech/remote-jobs@b1dd8deb19 (2026-08-13). Data as JSON: /api/errors/a158adce13860670. Report an issue: GitHub.