Skip to content

Validate that GAP directories only contain allowed files#35

Draft
magicmark wants to merge 1 commit into
graphql:mainfrom
magicmark:validate-allowed-files
Draft

Validate that GAP directories only contain allowed files#35
magicmark wants to merge 1 commit 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>
`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 “.”

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