mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
c021e94fce
Introduces a new http trigger in the Dashboard functions that returns all Pull Requests with merge conflicts. This allows us to show a list of PRs with merge conflicts in the dashboard. To ensure that the API calls are as fast as possible, the pull requests with conflicts are queried using Github's new GraphQL API.
25 lines
614 B
TypeScript
25 lines
614 B
TypeScript
import {githubApiV3} from './github-api';
|
|
|
|
/** Data that must be specified to set a Github PR status. */
|
|
export type GithubStatusData = {
|
|
result: boolean;
|
|
name: string;
|
|
description: string;
|
|
url?: string;
|
|
};
|
|
|
|
/** Function that sets a Github commit status */
|
|
export function setGithubStatus(commitSHA: string, data: GithubStatusData) {
|
|
const state = data.result ? 'success' : 'failure';
|
|
|
|
return githubApiV3.repos.createStatus({
|
|
owner: 'angular',
|
|
repo: 'material2',
|
|
sha: commitSHA,
|
|
state: state,
|
|
target_url: data.url,
|
|
description: data.description,
|
|
context: data.name,
|
|
});
|
|
}
|