Skip to content

Fix: stale forks fail the signature check and get told to remove other people's files - #54

Merged
geetxnshgoyal merged 1 commit into
mainfrom
fix/diff-against-merge-base
Sep 22, 2026
Merged

geetxnshgoyal merged 1 commit into
mainfrom
fix/diff-against-merge-base

Conversation

@geetxnshgoyal

Copy link
Copy Markdown
Member

Bug

The check compared current main with the PR head (git diff base head). A student who forked before other signatures were merged, like Prince in #44, saw every newer signature listed as a deletion in their PR. They failed with "This PR changes 8 files", and the bot told them to remove other people's files.

Fix

One line: git diff base...head (three dots) compares against the merge base, the point where the student's branch started. That's exactly what the PR's Files changed tab shows.

Tested

  • New case: a student branches, main gains two other signatures, then the PR is checked. It now shows only A signatures/<user>.md and passes. The old code listed the other signatures as deletions, which matches the Sign the workbook: Prince sharma #44 screenshot.
  • All 9 existing cases still pass.

This PR's own check fails by design (it isn't a signature), so it needs an admin merge. After merging, re-run the failed checks on open PRs so the bot corrects any wrong comments.

The check diffed main's current tip against the PR head (two dots), so a
student who forked before other signatures were merged saw those as
deletions in their PR, failed, and the bot told them to remove other
people's files. Use a three-dot diff (merge base), which is what the PR's
Files changed tab shows.
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Hi @geetxnshgoyal 👋 thanks for signing the workbook! The check found a problem:

  • Your file must be named exactly signatures/geetxnshgoyal.md — your GitHub username, capitals included. Yours is .github/workflows/validate-signature.yml. Fix it with: git mv ".github/workflows/validate-signature.yml" signatures/geetxnshgoyal.md

How to fix it (in your clone, on the same branch as this PR):

# fix the file as described above, then:
git add -A
git commit -m "Fix signature"
git push

Your file should look like:

# Your Real Name

- **GitHub:** @geetxnshgoyal
- **Batch:** 2026
- **I'm here to:** your own line
- **One thing I've built:** a link, or nothing yet

Push to this same PR. Don't open a new one. This comment updates itself each time the check re-runs.

@geetxnshgoyal
geetxnshgoyal merged commit 6daf036 into main Sep 22, 2026
1 of 2 checks passed
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.

1 participant