{"id":31642217,"url":"https://github.com/teneplaysofficial/sheriff","last_synced_at":"2026-04-21T10:06:00.665Z","repository":{"id":311398804,"uuid":"1038684065","full_name":"teneplaysofficial/sheriff","owner":"teneplaysofficial","description":"🤠 Enforce Conventional Commits on pull request titles like a true sheriff","archived":false,"fork":false,"pushed_at":"2025-08-24T07:29:18.000Z","size":285,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T14:05:00.238Z","etag":null,"topics":["actions","actions-lib","automation","ci","conventional-commits","formatting","lint","linter","tool","utility","validation"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/sheriff-action-ci","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teneplaysofficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2025-08-15T16:35:44.000Z","updated_at":"2025-08-24T07:29:21.000Z","dependencies_parsed_at":"2025-08-24T14:05:10.234Z","dependency_job_id":null,"html_url":"https://github.com/teneplaysofficial/sheriff","commit_stats":null,"previous_names":["teneplaysofficial/sheriff"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/teneplaysofficial/sheriff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fsheriff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fsheriff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fsheriff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fsheriff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teneplaysofficial","download_url":"https://codeload.github.com/teneplaysofficial/sheriff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fsheriff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717450,"owners_count":26033542,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["actions","actions-lib","automation","ci","conventional-commits","formatting","lint","linter","tool","utility","validation"],"created_at":"2025-10-07T03:57:14.840Z","updated_at":"2026-04-21T10:06:00.647Z","avatar_url":"https://github.com/teneplaysofficial.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./assets/logo.png\" alt=\"Sheriff logo\" width=\"200\"/\u003e\n\n# 🕵️ Sheriff\n\n_Enforce Conventional Commits on pull request titles like a true sheriff, keep your repo law-abiding!_\n\n\u003c/div\u003e\n\n[![tests](https://github.com/teneplaysofficial/sheriff/actions/workflows/tests.yml/badge.svg)](https://github.com/TenEplaysOfficial/sheriff)\n\n## 📜 Overview\n\n**Sheriff** is a GitHub Action that patrols your pull requests and ensures titles follow a strict format. Perfect for enforcing [**Conventional Commits**](https://www.conventionalcommits.org) or your own custom rules.\n\n\u003e No more wild, lawless PR titles - the Sheriff keeps things tidy.\n\n## ✨ Features\n\n- Enforces the **`type(scope): message`** format\n- Supports **multiple scopes (comma-separated)** - `type(scope1,scope2): message`\n- Detects **breaking changes** (`!`) and checks if they’re allowed\n- Optional **strict scope enforcement**\n- Fully configurable commit **types** \u0026 **scopes**\n- Enforces **lowercase types**\n- Prevents empty messages and malformed titles\n- Clear, **human-friendly error messages**\n- Instantly fails CI if rules are broken\n- Works in any PR workflow\n- Optionally ignores PRs from specific authors (bots, automation)\n\n## 🤠 How to Deputize the Sheriff\n\n\u003e _Follow these steps and your repo will be safer than a vault in Fort Knox._\n\n1. **Star the repo** - show the Sheriff some love before he starts working 😁\n2. **Create a workflow file**: `.github/workflows/check-pr-title.yml`\n3. **Copy this template**:\n\n   ```yml\n   name: PR Title Check\n\n   on:\n     pull_request:\n       types: [opened, edited, reopened]\n\n   jobs:\n     sheriff:\n       runs-on: ubuntu-latest\n       steps:\n         - name: Validate PR title\n           uses: teneplaysofficial/sheriff@v5\n           with:\n             types: feat, fix, docs, ci, test, chore\n             scopes: |\n               core\n               api\n               ui\n               docs\n             allow_breaking: true\n             enforce_scopes: true\n             ignore-authors: https://raw.githubusercontent.com/teneplaysofficial/sheriff/main/src/data/ignored-authors.txt\n   ```\n\n4. **Commit \u0026 push** - the Sheriff is now on duty.\n   Any outlaw PR title will be gunned down.\n\n## 🔧 Inputs\n\n| Name             | Required | Default                                | Description                                   |\n| ---------------- | -------- | -------------------------------------- | --------------------------------------------- |\n| `types`          | No       | Sourced from `@js-utils-kit/constants` | List of allowed commit types                  |\n| `scopes`         | No       | Sourced from `@js-utils-kit/constants` | List of allowed scopes                        |\n| `allow_breaking` | No       | `true`                                 | Whether breaking changes (`!`) are allowed    |\n| `enforce_scopes` | No       | `false`                                | If `true`, only configured scopes are allowed |\n| `ignore-authors` | No       | `false`                                | Ignore PRs created by specific authors        |\n\n\u003e [!NOTE]\n\u003e Multiple scopes in PR titles must be **comma-separated** (`feat(core,api): message`)\n\n## 🚫 Ignoring PR Authors\n\nSheriff can **skip validation entirely** for pull requests created by specific authors (e.g. dependency bots, CI users, or internal automation).\n\nThis is controlled using **one input**: `ignore-authors`.\n\n### 🔧 `ignore-authors` values\n\n| Value     | Behavior                                |\n| --------- | --------------------------------------- |\n| `true`    | Use the default ignore file             |\n| `false`   | Disable ignore-authors feature          |\n| File path | Load ignored authors from that file     |\n| HTTPS URL | Load ignored authors from a remote file |\n\n### 📄 Default Ignore File\n\nWhen `ignore-authors: true`, Sheriff loads: [src/data/ignored-authors.txt](./src/data/ignored-authors.txt)\n\n\u003e relative to the repository root\n\n### 📄 Ignore File Format\n\n```txt\n# One author per line\n# Format:\n#   name \u003cemail\u003e\n\nrenovate[bot] \u003c29139614+renovate[bot]@users.noreply.github.com\u003e\ndependabot[bot] \u003c49699333+dependabot[bot]@users.noreply.github.com\u003e\n```\n\nRules:\n\n- Empty lines are allowed\n- Lines starting with `#` are comments\n- Inline comments are allowed\n- Entries **must** be in `name \u003cemail\u003e` format\n\n### 🌍 Using a Remote Ignore File\n\n```yml\n- uses: teneplaysofficial/sheriff@v5\n  with:\n    ignore-authors: https://raw.githubusercontent.com/org/sheriff-config/main/ignored-authors.txt\n```\n\n## 📤 Outputs\n\n| Name    | Description                                                           |\n| ------- | --------------------------------------------------------------------- |\n| `valid` | `true` if the PR title passes validation **or** the author is ignored |\n\n## ✅ Good PR Titles\n\nSheriff-approved examples:\n\n- `feat(api): add authentication support`\n- `fix(core,ui): resolve dark mode toggle bug`\n- `docs: update contributing guide`\n- `feat!: drop legacy API support`\n- `BREAKING CHANGE: remove deprecated auth flow`\n\n## 🚫 Bad PR Titles\n\nTitles that’ll land you in PR jail:\n\n- `Feature: add login` → type must be lowercase\n- `feat(auth):` → message cannot be empty\n- `fix(core | ui): bug fix` → scopes must be comma-separated\n- `feat(): empty scope` → empty scope not allowed\n- `performance(core): rename variables` → type not allowed\n\n## 🔨 How It Works\n\n1. Sheriff loads **default commit types** and **scopes** from constants.\n2. Workflow inputs **override defaults** when provided.\n3. The PR title is validated step-by-step:\n   - Structure check via regex\n   - Whitespace and formatting rules\n   - Empty message detection\n   - Commit type validation\n   - Optional scope enforcement\n   - Breaking change rules\n\n4. If any rule fails, CI fails with a **clear error reason**.\n5. If `[skip-ci]` is present **at the end of the title**, validation is skipped.\n6. If the PR author is ignored, validation is **skipped safely**.\n\n## 📜 License\n\nReleased under the [Apache-2.0](LICENSE) License.\n\n_The Sheriff works free of charge, but tips are appreciated in the form of stars._ ⭐\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteneplaysofficial%2Fsheriff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteneplaysofficial%2Fsheriff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteneplaysofficial%2Fsheriff/lists"}