{"id":16694697,"url":"https://github.com/weetbix/configurable-required-approvals","last_synced_at":"2025-10-13T01:03:13.349Z","repository":{"id":172719252,"uuid":"649646731","full_name":"Weetbix/configurable-required-approvals","owner":"Weetbix","description":"Enforce a number of required reviews for certain files","archived":false,"fork":false,"pushed_at":"2024-07-17T02:27:37.000Z","size":1545,"stargazers_count":5,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T01:03:04.132Z","etag":null,"topics":["gha","github","github-actions","monorepo","review","review-tools","reviews"],"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/Weetbix.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-05T10:32:14.000Z","updated_at":"2025-06-19T19:23:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"3df68729-0a9a-4410-b5a7-5a7b0e22d818","html_url":"https://github.com/Weetbix/configurable-required-approvals","commit_stats":null,"previous_names":["weetbix/required-approvals"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/Weetbix/configurable-required-approvals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weetbix%2Fconfigurable-required-approvals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weetbix%2Fconfigurable-required-approvals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weetbix%2Fconfigurable-required-approvals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weetbix%2Fconfigurable-required-approvals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Weetbix","download_url":"https://codeload.github.com/Weetbix/configurable-required-approvals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Weetbix%2Fconfigurable-required-approvals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013885,"owners_count":26085325,"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-12T02:00:06.719Z","response_time":53,"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":["gha","github","github-actions","monorepo","review","review-tools","reviews"],"created_at":"2024-10-12T16:47:43.099Z","updated_at":"2025-10-13T01:03:13.322Z","avatar_url":"https://github.com/Weetbix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configurable Required Approvals GitHub Action\n\nThis GitHub Action checks if specific files in a pull request have the required number of approvals.\nIt allows you to define groups of files using glob patterns and specify the minimum number of approvals required for each group.\n\n## Why\n\nGitHub only lets you set the required number of approvals on a global level. In a monorepo, we may have sensitive projects which\nrequire more than 1 reviewer, and we dont want to force multiple approvals on all of the monorepo.\n\nWith this action, you can set paths and approval requirements based on file change globs, and then make this check required.\n\n## How\n\nIn order to avoid pull requests showing a red ❌ when the required approvals are not met (which may deter futher reviewers),\nthis action always succeeds. If the approval requirements are met, the action will **add an additional check to the pull request\nwith the name \"Required number of approvals met\"**.\n\nIf the required approvals are not met, the additional status check will _not be added_, and the PR will show in a pending state.\n\nUsers of this action should set this additional check (`Required number of approvals met`) as required in the branch protection settings.\n\n### Example of a PR without the required approvals\n\n\u003cimg width=\"500\" src=\"images/pending_checks_pr_list.png\" /\u003e\n\u003cimg width=\"500\" src=\"images/pending_checks.png\" /\u003e\n\n### Example of a PR with required approvals and check\n\n\u003cimg width=\"500\" src=\"images/completed_checks.png\" /\u003e\n\n### Pitfalls\n\nWhen there are multiple workflows running in parallel, the check will be randomly attached\nto one of the workflows, instead of the originating workflow.\n\nIf you want to fix this, you must use a GitHub App token. See for example: https://github.com/LouisBrunner/checks-action/issues/26#issuecomment-1232948025\n\n## Usage\n\nHere's an example workflow configuration:\n\n```yaml\nname: Required Approvals\n\non:\n  pull_request:\n  pull_request_review:\n\npermissions:\n  checks: write\n  pull-requests: read\n\njobs:\n  required-approvals:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Check required approvals\n        uses: weetbix/configurable-required-approvals@v1\n        with:\n          requirements: |\n            - patterns:\n                - \"frontend/packages/kinda-sensitive/**/*\"\n                - \"frontend/packages/kinda-sensitive-2/**/*\"\n              requiredApprovals: 2\n            - patterns:\n                - \"very-sensitive/**/*\"\n              requiredApprovals: 3\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\nYou would then make `Required number of approvals met` a required check in the repository's branch protection.\n\n## Inputs\n\n- `requirements`: A YAML-formatted list of requirements. Each requirement consists of `patterns` (an array of glob patterns) and `requiredApprovals` (the minimum number of approvals required). Example:\n\n  ```yaml\n  requirements: |\n    - patterns:\n        - \"frontend/packages/cool-app/**/*\"\n      requiredApprovals: 2\n    - patterns:\n        - \"backend/**/*\"\n        - \"shared/**/*\"\n      requiredApprovals: 3\n  ```\n\n- `github-token` (required): The GitHub token used to authenticate API requests. You can use the `${{ secrets.GITHUB_TOKEN }}` secret token provided by GitHub.\n\n## Behavior\n\n- If none of the files in the specified patterns are touched in the pull request, the action sets the custom check.\n- If files in the specified patterns are touched, the action checks if the pull request has the required number of approvals.\n- If the required number of approvals is not met, the action does not set the custom check.\n- Always succeed on the `pull_request` event when there are no reviews yet, so that you can set this check as `required` in branch protection.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweetbix%2Fconfigurable-required-approvals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweetbix%2Fconfigurable-required-approvals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweetbix%2Fconfigurable-required-approvals/lists"}