Fix: don't try to migrate cms prs from forks (#3331)

This commit is contained in:
Erez Rokah
2020-02-27 18:24:39 +01:00
committed by GitHub
parent 908c42fb58
commit 3e873f3e02
42 changed files with 9292 additions and 8472 deletions

View File

@ -62,13 +62,17 @@ type GraphQLPullRequest = {
title: string;
mergedAt: string | null;
labels: { nodes: { name: string }[] };
repository: {
id: string;
isFork: boolean;
};
};
const transformPullRequest = (pr: GraphQLPullRequest) => {
return {
...pr,
labels: pr.labels.nodes,
head: { ref: pr.headRefName, sha: pr.headRefOid },
head: { ref: pr.headRefName, sha: pr.headRefOid, repo: { fork: pr.repository.isFork } },
base: { ref: pr.baseRefName, sha: pr.baseRefOid },
};
};
@ -266,13 +270,14 @@ export default class GraphQLAPI extends API {
);
}
async getCmsBranches() {
async getOpenAuthoringBranches() {
const { repoOwner: owner, repoName: name } = this;
const { data } = await this.query({
query: queries.cmsBranches,
query: queries.openAuthoringBranches,
variables: {
owner,
name,
refPrefix: `refs/heads/cms/${this.repo}/`,
},
});