MCPcopy Index your code
hub / github.com/wei/pull / getPullConfig

Function getPullConfig

src/utils/get-pull-config.ts:78–102  ·  view source on GitHub ↗
(
  octokit: ProbotOctokit,
  log: Logger,
  jobData: SchedulerJobData,
)

Source from the content-addressed store, hash-verified

76}
77
78export async function getPullConfig(
79 octokit: ProbotOctokit,
80 log: Logger,
81 jobData: SchedulerJobData,
82): Promise<PullConfig | null> {
83 log.info(`⚙️ Fetching config`);
84
85 const { owner, repo } = jobData;
86
87 const { data: repository } = await octokit.rest.repos.get({ owner, repo });
88
89 if (repository.archived) {
90 log.debug(`⚠️ Repository is archived, skipping`);
91 return null; // TODO Cancel scheduled job
92 }
93
94 let config = await getLivePullConfig(octokit, log, jobData);
95 if (!config && !repository.fork) {
96 return null; // TODO Cancel scheduled job
97 } else if (!config) {
98 config = getDefaultPullConfig(repository, log);
99 }
100
101 return config;
102}

Callers 3

processRepoFunction · 0.90
checkHandlerFunction · 0.90
mainFunction · 0.90

Calls 2

getLivePullConfigFunction · 0.85
getDefaultPullConfigFunction · 0.85

Tested by

no test coverage detected