{"id":26103332,"url":"https://github.com/topfreegames/codeowners-verifier","last_synced_at":"2025-04-12T17:23:28.451Z","repository":{"id":45078837,"uuid":"279629886","full_name":"topfreegames/codeowners-verifier","owner":"topfreegames","description":"Small binary to verify if a path has a CODEOWNER.","archived":false,"fork":false,"pushed_at":"2023-02-28T14:13:10.000Z","size":65,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-12T17:23:11.234Z","etag":null,"topics":["codeowners","github","gitlab"],"latest_commit_sha":null,"homepage":"","language":"Go","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/topfreegames.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}},"created_at":"2020-07-14T15:55:07.000Z","updated_at":"2023-11-13T12:36:33.000Z","dependencies_parsed_at":"2024-06-20T21:51:02.198Z","dependency_job_id":"d35e1d85-a8e8-4d48-a3a8-4bd750b6bae7","html_url":"https://github.com/topfreegames/codeowners-verifier","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fcodeowners-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fcodeowners-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fcodeowners-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fcodeowners-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topfreegames","download_url":"https://codeload.github.com/topfreegames/codeowners-verifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602759,"owners_count":21131689,"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":["codeowners","github","gitlab"],"created_at":"2025-03-09T20:06:28.457Z","updated_at":"2025-04-12T17:23:28.414Z","avatar_url":"https://github.com/topfreegames.png","language":"Go","readme":"# codeowners-verifier\n\nSmall binary to validate the CODEOWNERS file and check if a path matches a CODEOWNER entry.\nUseful for using on CI to ensure CODEOWNERS coverage.\n\n## Docker\n\nAvailable at: [Docker Hub](https://hub.docker.com/r/tfgco/codeowners-verifier) and [Quay.io](https://quay.io/repository/tfgco/codeowners-verifier).\nYou can change build arguments for GOOS and GOARCH using `--build-arg GOOS=linux --build-arg GOARCH=arm`.\n\n## Overview\n\ncodeowners-verifier verifies the entries inside a CODEOWNERS file. At the time being, it only supports Gitlab Code Owners. Although CodeOwners works the same way for Gitlab and Github (the same validation checks are done by both), Wildlife's implementation also checks for valid Users and Groups inside a CODEOWNERS file.\n\n## Environment Variables\n\n+ `CODEOWNER_PROVIDER_URL`: The URL to the chosen provider. Each provider will have a default value.\n+ `CODEOWNER_PROVIDER_TOKEN`: Token to authenticate toward the chosen provider. There isn't default.\n+ `CODEOWNER_PATH`: Path to the CODEOWNERS file. There isn't a default.\n\nThose environment variables may also be defined by the respective flags: `--base-url`, `--codeowners` and `--token`.\n\nA combination of using both flags and environment variables is possible, but keep in mind that flag values override environment variables values.\n\n## Usage\n\n:warning: Following how [.gitignore files works](https://git-scm.com/docs/gitignore), we didn't implement the \"negate pattern\". Github doesn't support it too. :warning:\n\n**There are three verbs available: `help`, `verify` and `validate`.**\n\n### Help\n\nHelp displays basic help message on the available verbs and global flags. Can also be used to get help on the available verbs:\n\n```bash\n./codeowners-verifier help verify\n```\n\n### Verify\n\nVerify must receive a path as argument. It then checks if the given path is covered by any of the existing entries.\n\n:warning: This runs against the relative path of the git repository\n\nExample:\n\n```bash\ncodeowners-verifier verify dir1/\nINFO[0000] Found matching rule on line 7: /**/ [@group1]\n```\n\nVerify supports the `-i (--ignore)` flag to ignore users/groups. It can be used multiples times and/or by a comma separated list of groups/users.\n\n```bash\ncodeowners-verifier verify dir1/ -i @user1 --ignore @user2\nINFO[0000] Found matching rule on line 7: /**/ [@group1]\n\ncodeowners-verifier verify dir1/ -i @user1 -i @user2,@group1\nFATA[0000] Missing CODEOWNER entry, matched rule from line 7 don't have valid owners: /**/ [@group1]. Check your ignore rules.\n```\n\n### Validate\n\nValidate validates the entire CODEOWNERS file, checking if the users and/or groups are valid. It does that by checking if the user or group is valid on the provider API.\n\nIt must receive the name of the provider. YOu can check for the available providers by executing the help:\n\n```bash\ncodeowners-verifier validate -h\n```\n\nThen, execute with the provider name:\n\n```bash\ncodeowners-verifier validate gitlab\nINFO[0007] Valid CODEOWNERS file\n```\n\nIn case something is wrong:\n\n```bash\ncodeowners-verifier validate gitlab\nERRO[0007] Error parsing line 7: user/group @user1 is invalid \nERRO[0007] Error parsing line 8, path test-dir/ does not exist \nERRO[0008] Error parsing line 8: user/group @group1 is invalid \nERRO[0008] Error parsing line 8: user/group @group2 is invalid \nFATA[0008] Invalid CODEOWNERS file\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Fcodeowners-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopfreegames%2Fcodeowners-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Fcodeowners-verifier/lists"}