function verifyExpectedArgs()

in github-projects/map-labels/index.ts [100:122]


function verifyExpectedArgs(args: ActionArgs): asserts args is {
  owner: string;
  projectNumber: number;
  issueNumber: number[];
  githubToken: string;
  all: boolean;
  mapping: string;
  dryRun: boolean;
  repo?: string;
} {
  if (!args.owner) {
    throw new Error('Owner from context or args cannot be inferred, but is required');
  }
  if (!args.projectNumber) {
    throw new Error('Project number is required for a single issue update');
  }
  if (!args.githubToken) {
    throw new Error('GitHub token is required for authentication');
  }
  if (args.issueNumber?.length && args.all) {
    throw new Error('Either "issueNumber" or "all" should be specified at once');
  }
}