raulfdm/codeowners-flow

Define config API

raulfdm opened this issue · 0 comments

API config

Every project would include a codeowner.config.mjs. This file must default return an array of objects.

Each object should contain:

type OwnerRule = {
  pattern: string,
  excludeMatch?: string[],
  owners: string[],
  comments?: string[]
}

type CodeOwnerManager = {
  outDir: string;
  rules: OwnerRule[]
}

Example:

export default {
  outDir: ".github",
  rules: [
    {
      pattern: "*",
      owners: ["@company/core-team"],
      comments: [
        "Everything else will be fallback to @company/core-team to approve",
      ],
    },
  ],
};

This will lead to a .github/CODEOWNERS with the following content:

# Everything else will be fallback to @company/core-team to approve
* @company/core-team