{"id":13532704,"url":"https://github.com/xt0rted/block-autosquash-commits-action","last_synced_at":"2025-04-09T12:07:05.216Z","repository":{"id":37315631,"uuid":"173670900","full_name":"xt0rted/block-autosquash-commits-action","owner":"xt0rted","description":"A Github Action to prevent merging pull requests containing autosquash commit messages.","archived":false,"fork":false,"pushed_at":"2024-08-26T23:51:55.000Z","size":537,"stargazers_count":18,"open_issues_count":6,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T10:02:06.702Z","etag":null,"topics":["github-actions","prevent-merging","squash-commits","workflows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xt0rted.png","metadata":{"funding":{"github":"xt0rted","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-04T03:59:40.000Z","updated_at":"2024-05-23T22:04:02.000Z","dependencies_parsed_at":"2023-02-10T12:31:03.251Z","dependency_job_id":"851ea81b-2961-497d-abf7-0ee1487249ff","html_url":"https://github.com/xt0rted/block-autosquash-commits-action","commit_stats":{"total_commits":275,"total_committers":5,"mean_commits":55.0,"dds":0.5345454545454545,"last_synced_commit":"87d56ca2c3f01b9247504ead67a1a3c2ca62b030"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fblock-autosquash-commits-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fblock-autosquash-commits-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fblock-autosquash-commits-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xt0rted%2Fblock-autosquash-commits-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xt0rted","download_url":"https://codeload.github.com/xt0rted/block-autosquash-commits-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","prevent-merging","squash-commits","workflows"],"created_at":"2024-08-01T07:01:13.046Z","updated_at":"2025-04-09T12:07:05.194Z","avatar_url":"https://github.com/xt0rted.png","language":"JavaScript","funding_links":["https://github.com/sponsors/xt0rted"],"categories":["Community Resources"],"sub_categories":["Pull Requests"],"readme":"# Block Autosquash Commits Action\n\n[![CI](https://github.com/xt0rted/block-autosquash-commits-action/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xt0rted/block-autosquash-commits-action/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/xt0rted/block-autosquash-commits-action/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/xt0rted/block-autosquash-commits-action/actions/workflows/codeql-analysis.yml)\n\n\nA Github Action to prevent merging pull requests containing [autosquash](https://git-scm.com/docs/git-rebase#git-rebase---autosquash) commit messages.\n\n## How it works\n\nIf any commit message in the pull request starts with `fixup!` or `squash!` the check status will be set to `error`.\n\n\u003e⚠️ GitHub's API only returns the first 250 commits of a PR so if you're working on a really large PR your fixup commits might not be detected.\n\n## Usage\n\n```yaml\non: pull_request\n\nname: Pull Requests\n\njobs:\n  message-check:\n    name: Block Autosquash Commits\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Block Autosquash Commits\n        uses: xt0rted/block-autosquash-commits-action@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nYou'll also need to add a [required status check](https://help.github.com/en/articles/enabling-required-status-checks) rule for your action to block merging if it detects any `fixup!` or `squash!` commits.\n\n### Control Permissions\n\nIf your repository is using [control permissions](https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/) you'll need to set `pull-request: read` on either the workflow or the job.\n\n#### Workflow Config\n\n```yaml\non: pull_request\n\nname: Pull Request\n\npermissions:\n  pull-requests: read\n\njobs:\n  message-check:\n    name: Block Autosquash Commits\n\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Block Autosquash Commits\n        uses: xt0rted/block-autosquash-commits-action@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n#### Job Config\n\n```yaml\non: pull_request\n\nname: Pull Request\n\njobs:\n  message-check:\n    name: Block Autosquash Commits\n\n    runs-on: ubuntu-latest\n\n    permissions:\n      pull-requests: read\n\n    steps:\n      - name: Block Autosquash Commits\n        uses: xt0rted/block-autosquash-commits-action@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxt0rted%2Fblock-autosquash-commits-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxt0rted%2Fblock-autosquash-commits-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxt0rted%2Fblock-autosquash-commits-action/lists"}