Categorygithub.com/njegosrailic/codeowners-validator
modulepackage
0.1.0
Repository: https://github.com/njegosrailic/codeowners-validator.git
Documentation: pkg.go.dev

# README

Codeowners Validator

forthebadge forthebadge

Overview

The Codeowners Validator project validates the GitHub CODEOWNERS file.

Local Installation

go get -u github.com/mszostok/codeowners-validator

Usage

Use the following environment variables to configure the application:

NameRequiredDefaultDescription
REPOSITORY_PATHYes-The repository path to your repository on your local machine.
GITHUB_ACCESS_TOKENNo-The GitHub access token. Instruction for creating token can be found here. If not provided then validating owners functionality could not work properly, e.g. you can reach the API calls quota or if you are setting GitHub Enterprise base URL then an unauthorized error can occur.
GITHUB_BASE_URLNohttps://api.github.com/The GitHub base URL for API requests. Defaults to the public GitHub API, but can be set to a domain endpoint to use with GitHub Enterprise.
GITHUB_UPLOAD_URLNohttps://uploads.github.com/The GitHub upload URL for uploading files.

It is taken into account only when the GITHUB_BASE_URL is also set. If only the GITHUB_BASE_URL is provided then this parameter defaults to the GITHUB_BASE_URL value.
VALID_OWNER_CHECKER_ORGANIZATION_NAMEYes-The organization name where the repository is created. Used to check if GitHub owner is in the given organization.

usage

Roadmap

Sorted with priority. First - most important.

  • Possibility to execute validator online. Automatically integrates with your GitHub account and allows you to check any repository online without the need to download and execute binary locally.
  • Possibility to use the GitHub URL instead of the path to the local repository.
  • Offline mode - execute all checks which not require internet connection against your local repository
  • Investigate the Go Plugins. Implement if it will simplify extending this tool with other checks.
  • Move to cobra library.
  • Add test coverage.
  • Add support for configuration via YAML file.
  • Move dep to go modules

Checks:

  • Unowned files (Not defined owners for given files)
  • Find doubles paths
  • File/directory does not exits
  • Works with teams as well
  • Support for private repos (see below)
  • User exist or not
  • Validate owners
    • check if owner definition is valid (GitHub user, organization team, email address)
    • check if GitHub owner have GitHub account
    • check if GitHub owner is in the given organization
    • check if Organization team exist

# Packages

No description provided by the author

# Structs

Config holds the application configuration.