{"id":50674043,"url":"https://github.com/garretpatten/codeowners-enforcer","last_synced_at":"2026-06-08T14:30:37.225Z","repository":{"id":212271961,"uuid":"518516232","full_name":"garretpatten/codeowners-enforcer","owner":"garretpatten","description":"GitHub Action that enforces every changed file in a PR has an effective owner in .github/CODEOWNERS.","archived":false,"fork":false,"pushed_at":"2026-05-29T00:21:56.000Z","size":75501,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-06T00:06:16.566Z","etag":null,"topics":["actions","automation","ci","code-review","codeowner","codeowners","codeowners-validator","compliance","continuous-integration","devops","github-actions","governance","nodejs","pull-request","repository-management","typescript","workflow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/garretpatten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"garretpatten"}},"created_at":"2022-07-27T15:35:25.000Z","updated_at":"2026-05-29T00:21:59.000Z","dependencies_parsed_at":"2025-03-08T18:23:43.767Z","dependency_job_id":"74115183-eb94-4e3a-a4c0-51f83c6095f1","html_url":"https://github.com/garretpatten/codeowners-enforcer","commit_stats":null,"previous_names":["garretpatten/codeowner-verifier","garretpatten/codeowners-enforcer"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/garretpatten/codeowners-enforcer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garretpatten%2Fcodeowners-enforcer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garretpatten%2Fcodeowners-enforcer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garretpatten%2Fcodeowners-enforcer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garretpatten%2Fcodeowners-enforcer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garretpatten","download_url":"https://codeload.github.com/garretpatten/codeowners-enforcer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garretpatten%2Fcodeowners-enforcer/sbom","scorecard":{"id":1245870,"data":{"date":"2023-12-17T19:32:58Z","repo":{"name":"github.com/garretpatten/codeowner-verifier","commit":"83ca56a4c00b6d712f4086ac34da1234ed1efb73"},"scorecard":{"version":"v4.10.5","commit":"27cfe92ed356fdb5a398c919ad480817ea907808"},"score":6.3,"checks":[{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: node_modules/@vercel/ncc/dist/ncc/mappings.wasm:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#branch-protection"}},{"name":"CI-Tests","score":10,"reason":"3 out of 3 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#ci-tests"}},{"name":"CII-Best-Practices","score":0,"reason":"no badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":0,"reason":"found 17 unreviewed human changesets","details":null,"documentation":{"short":"Determines if the project requires code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#code-review"}},{"name":"Contributors","score":0,"reason":"0 different organizations found -- score normalized to 0","details":["Info: contributors work for "],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#contributors"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: Dependabot detected: .github/dependabot.yaml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":null,"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: License file found in expected location: LICENSE:1","Info: FSF or OSI recognized license: LICENSE:1"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#license"}},{"name":"Maintained","score":10,"reason":"30 commit(s) out of 30 and 0 issue activity out of 8 found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"no published package detected","details":["Warn: no GitHub publishing workflow detected"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":8,"reason":"dependency not pinned by hash detected -- score normalized to 8","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/codeowner-verifier.yaml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/garretpatten/codeowner-verifier/codeowner-verifier.yaml/main?enable=pin","Info: GitHub-owned GitHubActions are pinned","Info: Dockerfile dependencies are pinned","Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles","Info: no insecure (not pinned by hash) dependency downloads found in shell scripts"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool","Warn: CodeQL tool not detected"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#sast"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: Found linked content in security policy: SECURITY.md","Info: Found text in security policy: SECURITY.md","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md","Info: security policy detected in current repo: SECURITY.md"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":["Warn: no GitHub releases found"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#signed-releases"}},{"name":"Token-Permissions","score":0,"reason":"non read-only tokens detected in GitHub workflows","details":["Info: High severity: topLevel 'contents' permission set to 'read': .github/workflows/codeowner-verifier.yaml:6","Info: High severity: topLevel permissions set to 'read-all': .github/workflows/ossf-scorecard.yaml:8","Warn: High severity: topLevel 'contents' permission set to 'write': .github/workflows/prettier.yaml:6: Visit https://app.stepsecurity.io/secureworkflow/garretpatten/codeowner-verifier/prettier.yaml/main?enable=permissions\nTick the 'Restrict permissions for GITHUB_TOKEN'\nUntick other options\nNOTE: If you want to resolve multiple issues at once, you can visit https://app.stepsecurity.io/securerepo instead. (Low effort)","Info: High severity: topLevel 'contents' permission set to 'read': .github/workflows/semgrep.yaml:10","Info: High severity: topLevel 'contents' permission set to 'read': .github/workflows/trufflehog-scan.yaml:4","Info: Medium severity: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":10,"reason":"no vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/27cfe92ed356fdb5a398c919ad480817ea907808/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2026-04-10T14:35:00.870Z","repository_id":212271961,"created_at":"2026-04-10T14:35:00.870Z","updated_at":"2026-04-10T14:35:00.870Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34067347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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","automation","ci","code-review","codeowner","codeowners","codeowners-validator","compliance","continuous-integration","devops","github-actions","governance","nodejs","pull-request","repository-management","typescript","workflow"],"created_at":"2026-06-08T14:30:36.170Z","updated_at":"2026-06-08T14:30:37.220Z","avatar_url":"https://github.com/garretpatten.png","language":"TypeScript","funding_links":["https://github.com/sponsors/garretpatten"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable-file MD033 MD041 --\u003e\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/logo.svg\" width=\"88\" height=\"88\" alt=\"Codeowners Enforcer logo\"/\u003e\n\n# Codeowners Enforcer\n\n**Enforce that every changed file has an effective owner before merge.**\n\n\u003csub\u003eGitHub Action · \u003ccode\u003e.github/CODEOWNERS\u003c/code\u003e · pull requests \u0026amp; pushes\u003c/sub\u003e\n\n\u003cbr/\u003e\n\n[![GitHub Actions](https://img.shields.io/badge/GitHub-Action-2088FF?style=flat-square\u0026logo=githubactions\u0026logoColor=white)](https://github.com/garretpatten/codeowners-enforcer)\n[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Codeowners_Enforcer-6f42c1?style=flat-square\u0026logo=github)](https://github.com/marketplace/actions/codeowners-enforcer)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![Issues](https://img.shields.io/github/issues/garretpatten/codeowners-enforcer?style=flat-square)](https://github.com/garretpatten/codeowners-enforcer/issues)\n[![License MIT](https://img.shields.io/github/license/garretpatten/codeowners-enforcer?style=flat-square)](https://github.com/garretpatten/codeowners-enforcer/blob/main/LICENSE)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/garretpatten/codeowners-enforcer/badge)](https://api.securityscorecards.dev/viewer/?uri=github.com/garretpatten/codeowners-enforcer)\n[![Release](https://img.shields.io/github/v/release/garretpatten/codeowners-enforcer?style=flat-square)](https://github.com/garretpatten/codeowners-enforcer/releases)\n\n\u003c/div\u003e\n\n---\n\nA GitHub Action that checks whether every **changed** file in a pull request or push has an effective owner according to `.github/CODEOWNERS`. Matching follows [GitHub’s CODEOWNERS rules](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) (gitignore-style patterns, root-anchored paths with a leading `/`, and **last matching pattern wins**—including lines that list a path with no owners).\n\nThe runtime entrypoint is the bundled `dist/index.js`, built with [`ncc`](https://github.com/vercel/ncc) from TypeScript sources under `src/`.\n\n## Why this action\n\nGitHub can require reviews from code owners, but that is separate from proving—inside your own workflow—that every path in a diff resolves to an owner line under the same rules GitHub documents. This action runs that check using only the file lists you pass in, so the **enforcer step** does not call the GitHub API and does not need `GITHUB_TOKEN` in its `with:` mapping—handy for **containers and minimal runners** once another step has produced the path lists.\n\n## GitHub Marketplace\n\n**[Codeowners Enforcer on the GitHub Marketplace](https://github.com/marketplace/actions/codeowners-enforcer)** — the listing uses this repository’s root **README** and **`action.yml`**. To publish or update a public action, follow [Publishing actions in the GitHub Marketplace](https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace) and keep [release tags](./CONTRIBUTING.md#releases-and-the-github-marketplace) in sync with the `dist/` bundle when `src/` changes.\n\n## Table of Contents\n\n- [Why this action](#why-this-action)\n- [GitHub Marketplace](#github-marketplace)\n- [Usage](#usage)\n  - [Pinning versions](#pinning-versions)\n  - [Minimal workflow example](#minimal-workflow-example)\n  - [Limits](#limits)\n- [Action inputs](#action-inputs)\n  - [changedFiles](#changedfiles)\n  - [deletedFiles](#deletedfiles)\n- [Action outputs](#action-outputs)\n- [Supporting files](#supporting-files)\n  - [.codeownersignore](#codeownersignore)\n- [Development](#development)\n- [Maintainers](#maintainers)\n- [Code of Conduct](#code-of-conduct)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Usage\n\nThis action is intended for public and private repositories. Add a workflow under `.github/workflows/`. This repository ships a full PR workflow in [`.github/workflows/codeowners-enforcer.yaml`](.github/workflows/codeowners-enforcer.yaml) (Alpine container, diff-based file lists, PR comments on failure, and safe handling of oversized inputs).\n\n### Pinning versions\n\nPrefer a **release tag** (for example `@v2`) or a **full commit SHA** for supply-chain stability. Branch pins such as `@main` are convenient for trying the latest commit but can change without notice. The example workflow in this repo pins **`@v2`**.\n\n### Minimal workflow example\n\n```yaml\njobs:\n  codeowners:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n      - name: Lists for this action\n        id: lists\n        run: |\n          echo \"changed=$(git diff --name-only HEAD^ HEAD | tr '\\n' ' ')\" \u003e\u003e \"$GITHUB_OUTPUT\"\n          echo \"deleted=$(git diff --name-only --diff-filter=D HEAD^ HEAD | tr '\\n' ' ')\" \u003e\u003e \"$GITHUB_OUTPUT\"\n      - uses: garretpatten/codeowners-enforcer@v2\n        with:\n          changedFiles: ${{ steps.lists.outputs.changed }}\n          deletedFiles: ${{ steps.lists.outputs.deleted }}\n```\n\nAdjust how you compute `changedFiles` and `deletedFiles` for your trigger (for example `pull_request` against the merge base); the in-repo example uses `origin/$GITHUB_BASE_REF` for pull requests.\n\n### Limits\n\n`changedFiles` and `deletedFiles` are passed through the runner as **environment variables**. If the combined UTF-8 size of both inputs is very large (default cap **100,000 bytes** in this action), verification is **skipped** with a warning and optional outputs `skipped` / `skipReason`, because oversized env payloads can exceed OS limits on environment or argument size (`ARG_MAX` / `execve`) and cause errors such as **Argument list too long** when starting Docker or the action process.\n\nThe example workflow measures list size first: if it would exceed the cap, it **does not** invoke the action with that payload, posts an explanatory PR comment, and the job **succeeds** (so CI is not blocked by runner limits). Split very large PRs or run CODEOWNERS checks locally when needed.\n\n### Action inputs\n\n#### changedFiles\n\nRequired. A **space-delimited** list of repository-relative paths for added or modified files. The example workflow builds this list with `git diff`.\n\n#### deletedFiles\n\nRequired. A **space-delimited** list of repository-relative paths for deleted or moved files (for example from `git diff --diff-filter=D`). Paths listed here are not reported as missing ownership.\n\nThis action does **not** call the GitHub API and does not require `secrets.GITHUB_TOKEN` or any other token in `with:`—only the path lists above.\n\n## Action outputs\n\n| Output         | When it is set                                                           | Meaning                                                                                                                    |\n| -------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |\n| `unownedFiles` | Same as `errorMessage`                                                   | Newline-separated paths with no effective owner—stable for workflow comments and scripting. Empty when the check passes.   |\n| `errorMessage` | Step **failed** because at least one changed file has no effective owner | Human-readable list of paths to fix in `.github/CODEOWNERS` (or `.github/.codeownersignore`). Empty when the check passes. |\n| `skipped`      | Inputs exceeded the [size limit](#limits)                                | Set to the string `true`; the step succeeds without verifying.                                                             |\n| `skipReason`   | Same as `skipped`                                                        | Explains why verification was skipped.                                                                                     |\n\nDownstream steps can branch on `steps.\u003cid\u003e.outputs.skipped` or inspect `unownedFiles` / `errorMessage` when using `continue-on-error: true` (as in the bundled example workflow).\n\n## Supporting files\n\n### .codeownersignore\n\nOptional. Patterns use the same gitignore-style semantics as CODEOWNERS (via the [`ignore`](https://www.npmjs.com/package/ignore) package). Put the file at **`.github/.codeownersignore`** (preferred) or **`.codeownersignore`** at the repository root (legacy). One pattern per line; `#` starts a comment; inline comments after a space and `#` are stripped.\n\n## Development\n\n- **Requirements:** Node.js and npm (npm **11+** recommended so `.npmrc` [`min-release-age`](https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age) applies during installs).\n- Install: `npm ci`\n- Check types: `npm run typecheck`\n- Test: `npm test`\n- Bundle for the action: `npm run build` (writes `dist/index.js`)\n- **CI:** Pull requests run [Security Checks](https://github.com/garretpatten/security-checks) (Semgrep, TruffleHog, etc.) and [Quality Checks](https://github.com/garretpatten/quality-checks) (Prettier, Markdownlint, Yamllint) via `.github/workflows/security-checks.yaml` and `.github/workflows/quality-checks.yaml`. Local parity: `.prettierignore` excludes `dist/` and `node_modules/`; run `npm run lint:prettier`, `npm run lint:md`, and `npm run lint:yaml` (requires [`yamllint`](https://github.com/adrienverge/yamllint) on your PATH).\n\n## Maintainers\n\n[@garretpatten](https://www.github.com/garretpatten)\n\n_For questions, bug reports, or feature requests, please open an issue on this repository or contact the maintainer directly._\n\n## Code of Conduct\n\nShort community rules and how to report problems: [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md).\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md). Everyone who participates is expected to follow the [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarretpatten%2Fcodeowners-enforcer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarretpatten%2Fcodeowners-enforcer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarretpatten%2Fcodeowners-enforcer/lists"}