Skip to content

Merge a learner's first pull request automatically - #51

Merged
thejesh23 merged 4 commits into
mainfrom
auto-merge-first-pr
Nov 26, 2026
Merged

thejesh23 merged 4 commits into
mainfrom
auto-merge-first-pr

Conversation

@thejesh23

Copy link
Copy Markdown
Owner

Until a learner's first pull request is merged, GitHub treats them as a first-time contributor and holds their Lesson 05 check for a maintainer's approval. So every learner waited on the maintainer twice before Lesson 05 showed a green check.

What changes

  • The first-commit bot merges a pull request that passes its check. Exercise 2 and graduate pull requests are still merged by a maintainer.
  • It uses the workflow's built-in token: no personal token or secret.
  • It makes a merge commit, not a squash, so the learner's main stays in step with ours.
  • It merges only the commit it checked (--match-head-commit).
  • The pull request's code is still never checked out or run.

Stricter checks, because nobody reads the file before it is merged

  • The file must be an ordinary file (not a symlink or an executable).
  • name and message can't contain links or @mentions.

Text

  • Lessons 02, 04 and 05, the promo script, the Udemy description and welcome message, README, CURRICULUM and CONTRIBUTING now say the bot merges the first pull request.
  • Tests guard both directions: only first-commit.yml may merge, and the lessons must say who merges what.

Videos for lectures 02 and 04 and the promo follow in a second pull request, after a live test of the merge.

🤖 Generated with Claude Code

thejesh23 and others added 4 commits November 26, 2026 15:07
Until a learner's first pull request is merged, GitHub holds their Lesson 05 check for a maintainer's approval, so every learner waited on the maintainer twice. The bot now merges the first pull request itself, with a merge commit, and only the commit it checked. Because nobody reads the file first, it must be an ordinary file and its text can't contain links or @mentions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@thejesh23
thejesh23 merged commit ab81934 into main Nov 26, 2026
3 checks passed
@thejesh23
thejesh23 deleted the auto-merge-first-pr branch November 26, 2026 23: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.

1 participant