Skip to content

ci: enforce single-commit PRs#1003

Merged
fdupress merged 1 commit intomainfrom
force-1-commit
May 8, 2026
Merged

ci: enforce single-commit PRs#1003
fdupress merged 1 commit intomainfrom
force-1-commit

Conversation

@strub
Copy link
Copy Markdown
Member

@strub strub commented May 8, 2026

Summary

  • Adds a GitHub Actions workflow that fails any PR whose commit count is not exactly 1.
  • Uses github.event.pull_request.commits from the PR event payload, so no checkout or git history fetch is required.
  • Triggers on opened, synchronize, and reopened — the only PR events that can change the commit count.

The repository is configured so that the check-commit-count job is a required status check, making this enforcement binding.

@strub strub self-assigned this May 8, 2026
@strub strub requested a review from fdupress May 8, 2026 07:00
@strub strub added the chore Ungrateful tasks that need done but that nobody wants to do label May 8, 2026
@strub
Copy link
Copy Markdown
Member Author

strub commented May 8, 2026

Work as expected when the PR has two commits.

image

@strub strub force-pushed the force-1-commit branch from 95ed4dd to 4bd0b71 Compare May 8, 2026 07:04
@fdupress
Copy link
Copy Markdown
Member

fdupress commented May 8, 2026

Can we have a tag that allows escape after review? I'd rather not have to force people to split PRs that make sense to keep over multiple commits. (But you and I could also bypass requirements and merge those by hand.)

@strub
Copy link
Copy Markdown
Member Author

strub commented May 8, 2026

Let's see when this happens. We can either decide to force merge on our side or to implement a different mechanism.

It seems that github stacked PR are on their way anyway. This should solve this problem.

@strub strub enabled auto-merge May 8, 2026 07:12
@strub strub added this pull request to the merge queue May 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 8, 2026
@fdupress fdupress added this pull request to the merge queue May 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 8, 2026
@fdupress
Copy link
Copy Markdown
Member

fdupress commented May 8, 2026

@strub the merge queue is failing to merge this, now repeatedly, "due to no response for status checks". All jobs succeed, but the notification job gets skipped. Did you change something in the merge queue configuration?

@fdupress
Copy link
Copy Markdown
Member

fdupress commented May 8, 2026

@strub the merge queue is failing to merge this, now repeatedly, "due to no response for status checks". All jobs succeed, but the notification job gets skipped. Did you change something in the merge queue configuration?

Answer: yes. The merge is waiting for the single-commit job to succeed, but that job is not configured to run in the merge queue. I'll fiddle this in.

@fdupress fdupress added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit dda4571 May 8, 2026
17 checks passed
@fdupress fdupress deleted the force-1-commit branch May 8, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Ungrateful tasks that need done but that nobody wants to do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants