Skip to content

Handle missing assets/ directory in asset validation workflow - #6

Closed
blitzbugg with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-validate-svgs-job
Closed

Handle missing assets/ directory in asset validation workflow#6
blitzbugg with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-validate-svgs-job

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown

The Validate SVGs and Metadata Action was failing with ENOENT when scripts/validate-assets.mjs attempted to scan assets/ in branches/commits where that directory is absent. This change makes the validator resilient to missing asset roots while preserving existing validation behavior when assets are present.

  • Root cause

    • Recursive discovery always called findFiles(assetsDir, ...) without checking whether assetsDir exists.
  • Change

    • Added an existence guard before recursive asset discovery.
    • If assets/ is missing, the script now follows its existing no-op path (Nothing to validate) instead of throwing.
  • Scope

    • Single-file change in scripts/validate-assets.mjs; no workflow or schema changes.
import { existsSync, readdirSync } from "node:fs";

if (args.length === 0) {
  if (existsSync(assetsDir)) {
    svgFiles.push(...findFiles(assetsDir, (f) => f.endsWith(".svg")));
    metaFiles.push(...findFiles(assetsDir, (f) => f.endsWith("metadata.json")));
  }
}

@blitzbugg
blitzbugg marked this pull request as ready for review August 31, 2026 10:42
Co-authored-by: blitzbugg <112957222+blitzbugg@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job validate SVGs and metadata Handle missing assets/ directory in asset validation workflow Aug 31, 2026
Copilot AI requested a review from blitzbugg August 31, 2026 10:43
@blitzbugg blitzbugg closed this Aug 31, 2026
@blitzbugg
blitzbugg deleted the copilot/fix-validate-svgs-job branch August 31, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants