Skip to content

Block amend! commits without a third-party action - #805

Open
adamkudrna wants to merge 1 commit into
masterfrom
maintenance/custom-autosquash-check
Open

adamkudrna wants to merge 1 commit into
masterfrom
maintenance/custom-autosquash-check

Conversation

@adamkudrna

Copy link
Copy Markdown
Member

Replace xt0rted/block-autosquash-commits-action in git.yml with a git log check.

Changes

  • Block amend! commits besides fixup! and squash!.
  • Keep the job name, which branch protection requires.
  • Limit the workflow token to contents: read.

Testing

  • Ran the script on a scratch repository: empty and clean ranges pass; fixup!, squash!, --fixup=amend, --fixup=reword, a non-tip fixup and an unknown base fail.
  • Did not run actionlint.

Review

Code and security reviews found nothing blocking.

Nits left:

  • A grep error would pass the job.
  • In a fork clone, the suggested origin/<base> may be stale.
  • A subject with invalid UTF-8 might not be listed (unverified).

Pre-existing:

  • Retargeting a pull request does not rerun the check, and a manual rerun uses the old base.

Comment thread .github/workflows/git.yml Resolved
Replace `xt0rted/block-autosquash-commits-action` with a `git log` check,
which blocks `amend!` commits besides `fixup!` and `squash!`. The job keeps
its name because branch protection requires it.
@adamkudrna
adamkudrna force-pushed the maintenance/custom-autosquash-check branch from 72e3177 to cc4e650 Compare November 30, 2026 18:59
@adamkudrna
adamkudrna marked this pull request as ready for review November 30, 2026 19:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

1 participant