Skip to content

Add validation to prevent registry.json modifications in PRs#15

Merged
bthos merged 5 commits into
mainfrom
copilot/sub-pr-14
Feb 13, 2026
Merged

Add validation to prevent registry.json modifications in PRs#15
bthos merged 5 commits into
mainfrom
copilot/sub-pr-14

Conversation

Copilot AI commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Enforces the documented policy that contributors must not commit registry.json changes, as CI automatically builds and commits it post-merge.

Changes

  • Early validation step: Checks for registry.json modifications after checkout using git merge-base to compare against main branch
  • Fail-fast behavior: Exits with clear error messages directing contributors to CONTRIBUTING.md before running any builds or tests
  • Full git history: Sets fetch-depth: 0 in checkout action to enable proper diff comparison
- name: Check for registry.json modifications
  run: |
    BASE_SHA=$(git merge-base origin/main HEAD)
    if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then
      echo "::error::registry.json was modified in this PR. Please remove it from your commit."
      echo "::error::CI automatically builds and commits registry.json after PR merge."
      exit 1
    fi

Addresses the scenario where both plugin changes and registry.json are committed together, which would otherwise cause conflicts with the automated registry build process.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

bthos and others added 3 commits February 13, 2026 21:37
- Update CONTRIBUTING.md and README.md to clarify plugin submission steps and emphasize CI's role in validation and registry building.
- Introduce new plugins: Billing, Goals, Pomodoro Timer, and Projects & Tasks, each with metadata and versioning.
- Implement GitHub Actions workflows for automatic validation and registry updates upon PR merges.
- Adjust validation scripts to improve error handling and streamline the validation process.

Signed-off-by: bthos <bthos@example.com>
Signed-off-by: bthos <el.mogul@outlook.es>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: bthos <13679349+bthos@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on documentation and CI workflows Add validation to prevent registry.json modifications in PRs Feb 13, 2026
Copilot AI requested a review from bthos February 13, 2026 20:49
Base automatically changed from Update-contribution-guides to main February 13, 2026 20:57
@bthos bthos marked this pull request as ready for review February 13, 2026 21:00
Copilot AI review requested due to automatic review settings February 13, 2026 21:01
@bthos bthos merged commit 9cf03fd into main Feb 13, 2026
5 of 6 checks passed
@bthos bthos deleted the copilot/sub-pr-14 branch February 13, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to enforce the documented policy that contributors must not commit registry.json changes by adding validation to detect and reject such modifications. However, the implementation has critical issues that prevent it from achieving its stated goal.

Changes:

  • Adds a validation step to check for registry.json modifications using git diff
  • Renames the validate-files npm script to validate-all
  • Updates documentation in README.md and CONTRIBUTING.md

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/build-registry.yml Adds registry.json modification check with fetch-depth: 0 for full git history
package.json Renames script from validate-files to validate-all
README.md Updates script name reference and documentation text
CONTRIBUTING.md Removes DCO-related documentation sections
registry.json Modifies last_updated timestamp

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
```

This runs: `validate-schemas` → `validate-plugins` → `validate` (skips registry validation if registry.json doesn't exist). Note: This does not build the registry - run `npm run build` first if you need to generate registry.json.
This runs: `validate-schemas` → `validate-plugins` → `validate` (skips registry validation if registry.json doesn't exist)

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The description text was updated but the note about not building the registry was removed. The original text "This does not build the registry - run npm run build first if you need to generate registry.json" provided important clarification that validate-all does not build the registry. This should be retained to avoid confusion, as the script name change from 'validate-files' to 'validate-all' might suggest it does everything including building.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +34
echo "Checking if registry.json was modified in this PR..."

# Get the base branch (main)
BASE_SHA=$(git merge-base origin/main HEAD)

# Check if registry.json was modified between base and HEAD
if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then
echo "::error::registry.json was modified in this PR. Please remove it from your commit."
echo "::error::CI automatically builds and commits registry.json after PR merge."

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The error message refers to "this PR" but the workflow runs on push to main (after merge), not during PR validation. The message should be updated to reflect that the check runs post-merge, or better yet, the check should be moved to a pull_request workflow where the message would be accurate.

Suggested change
echo "Checking if registry.json was modified in this PR..."
# Get the base branch (main)
BASE_SHA=$(git merge-base origin/main HEAD)
# Check if registry.json was modified between base and HEAD
if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then
echo "::error::registry.json was modified in this PR. Please remove it from your commit."
echo "::error::CI automatically builds and commits registry.json after PR merge."
echo "Checking if registry.json was modified in the changes pushed to main..."
# Get the base branch (main)
BASE_SHA=$(git merge-base origin/main HEAD)
# Check if registry.json was modified between base and HEAD
if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then
echo "::error::registry.json was modified directly in main. Please remove it from your commit."
echo "::error::CI automatically builds and commits registry.json on main after pull request merges."

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +32
BASE_SHA=$(git merge-base origin/main HEAD)

# Check if registry.json was modified between base and HEAD
if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

When running on push to main (after PR merge), HEAD is already on the main branch, so git merge-base origin/main HEAD will find the common ancestor, which should be the commit just before the merge. However, this logic is fragile and may not work correctly for direct pushes to main or when multiple commits are pushed together. Additionally, since the workflow has paths-ignore: registry.json (line 10-11), it won't even run if registry.json is the only modified file. The validation should be moved to a pull_request workflow for more reliable detection.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +39
- name: Check for registry.json modifications
run: |
echo "Checking if registry.json was modified in this PR..."

# Get the base branch (main)
BASE_SHA=$(git merge-base origin/main HEAD)

# Check if registry.json was modified between base and HEAD
if git diff --name-only $BASE_SHA HEAD | grep -q '^registry\.json$'; then
echo "::error::registry.json was modified in this PR. Please remove it from your commit."
echo "::error::CI automatically builds and commits registry.json after PR merge."
echo "::error::See CONTRIBUTING.md for details."
exit 1
fi

echo "✓ No registry.json modifications found"

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

This validation step runs on push events to main branch (after PRs are merged), not during pull request validation. This means contributors will only discover the issue after their PR is merged, which defeats the purpose of early validation. The check should be added to a pull_request workflow instead, such as validate-registry.yml or a dedicated PR validation workflow.

Copilot uses AI. Check for mistakes.
Comment thread registry.json
"$schema": "https://github.com/tmtrckr/plugins-registry/schemas/registry.schema.json",
"version": "1.0.0",
"last_updated": "2026-02-13T20:55:37.494Z",
"last_updated": "2026-02-13T20:30:19.826Z",

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

This PR modifies registry.json, which violates the policy it's trying to enforce. According to the PR description and CONTRIBUTING.md, contributors must not commit registry.json changes as CI automatically builds and commits it post-merge. This change should be removed from the PR.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Validate everything (schemas, plugins, and existing registry.json if present):

```bash
npm run validate-files

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The script name has been changed from 'validate-files' to 'validate-all', but this reference in the README still uses the old name. Update this to 'npm run validate-all' to match the new script name in package.json.

Suggested change
npm run validate-files
npm run validate-all

Copilot uses AI. Check for mistakes.
Comment thread CONTRIBUTING.md
```

Then commit with `-s` flag as shown above.
**⚠️ Important:** All PRs are checked for DCO sign-off. Commits without sign-off will fail the DCO check.

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The removal of DCO-related documentation (including email requirements, configuration instructions, and FAQ entries) appears unrelated to the PR's stated purpose of adding registry.json validation. This documentation removal should either be justified in the PR description or moved to a separate PR focused on documentation changes.

Copilot uses AI. Check for mistakes.
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.

3 participants