MCPcopy Create free account
hub / github.com/angular/dev-infra / createWorkflowForPullRequest

Function createWorkflowForPullRequest

github-actions/branch-manager/lib/main.ts:104–128  ·  view source on GitHub ↗

Create a workflow dispatch event to trigger the pr to be evaluated for mergeability.

(inputs: WorkflowInputs)

Source from the content-addressed store, hash-verified

102
103/** Create a workflow dispatch event to trigger the pr to be evaluated for mergeability. */
104async function createWorkflowForPullRequest(inputs: WorkflowInputs) {
105 /** An instance of the octokit Github client. */
106 const githubClient = await github();
107
108 // When a sha is provided we set the status on sha to note that mergeability check is about to start.
109 if (inputs.sha !== undefined) {
110 await githubClient.repos.createCommitStatus({
111 repo: inputs.repo,
112 owner: inputs.owner,
113 state: 'pending',
114 description: 'Mergibility check requested',
115 sha: inputs.sha,
116 context: 'mergeability',
117 });
118 }
119
120 console.info(`Requesting workflow run for: ${JSON.stringify(inputs)}`);
121 await githubClient.actions.createWorkflowDispatch({
122 owner: 'angular',
123 repo: 'dev-infra',
124 ref: 'main',
125 workflow_id: 'branch-manager.yml',
126 inputs,
127 });
128}
129
130/** The Octokit instance, if defined to allow token revocation after the action executes. */
131let _github: Octokit | null = null;

Callers 1

runFunction · 0.85

Calls 2

githubFunction · 0.85
stringifyMethod · 0.45

Tested by

no test coverage detected