Skip to content

Validate that GAP directories only contain allowed files#35

Draft
magicmark wants to merge 7 commits into
graphql:mainfrom
magicmark:validate-allowed-files
Draft

Validate that GAP directories only contain allowed files#35
magicmark wants to merge 7 commits into
graphql:mainfrom
magicmark:validate-allowed-files

Conversation

@magicmark
Copy link
Copy Markdown
Contributor

Adds a file allowlist check to validate-structure.js — GAP directories may now only contain *.md files and metadata.yml. Rejects unexpected files or subdirectories with a message pointing contributors to @graphql/gaps-editors.

Motivation: prevent files like .nvmrc from being merged that could inadvertently affect developer environments.

Draft PR: This PR was sent by Claude and may not have yet been reviewed by markl.

Restrict files in GAP directories to *.md and metadata.yml to prevent
files that could poison developer environments (e.g. .nvmrc) from being
merged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment thread scripts/validate-structure.js Outdated
`Unexpected directory "${entry}" found. GAP directories may only contain *.md files and metadata.yml. If you believe this is in error, please ping @graphql/gaps-editors.`,
);
}
if (entry === "metadata.yml" || entry.endsWith(".md")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& not startsWith “.”

magicmark and others added 6 commits June 2, 2026 11:22
Address review feedback: skip dotfiles (e.g. .gitkeep) from the
allowlist check, and permit metadata.json alongside metadata.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dotfiles like .nvmrc should still be rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Catches cases like .foo.md that would otherwise pass the .md check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two plain functions, no abstractions. Validates YYYY-MM.md and
YYYY-MM.yml in versions/, rejects dotfiles at both levels.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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