Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 676 Bytes

File metadata and controls

35 lines (30 loc) · 676 Bytes

Operator context

Some functional operator can use context information

Example:

- uses: MeilCli/common-lint-reporter/operator/...
  with:
    function: |
      () => github.repository

Context specification

interface GitHubContext {
    workspacePath: string;
    trimPath: (filePath: string) => string;
    owner: string;
    repository: string;
    pullRequest: number | null;
    commitSha: string;
    api: ApiContext | null;
}

interface ApiContext {
    changedFiles: ChangedFile[];
}

interface ChangedFile {
    path: string;
    additions: number;
    deletions: number;
}

github.api is only usable when use_api_context option is true