Skip to content

Commit 43ccf48

Browse files
authored
fix: GraphQL API call to create PR failing due to mistype (#10)
1 parent e3baee7 commit 43ccf48

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

dist/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,16 +1827,14 @@ async function getReposList(octokit, name, owner) {
18271827
q: `"${name}" user:${owner} in:file filename:package.json`
18281828
});
18291829

1830-
let processedRepo = {};
1830+
const processedRepo = {};
18311831
// filter() returns only the repos that are not present in processedRepo object, and adds them there to the list
1832-
const deduplicatedReposList = items.filter(({ repository: { id }}) => !processedRepo[id] && (processedRepo[id] = true));
1833-
1834-
return deduplicatedReposList;
1832+
return items.filter(({ repository: { id }}) => !processedRepo[id] && (processedRepo[id] = true));
18351833
}
18361834

18371835
async function createPr(octokit, branchName, id, commitMessage, defaultBranch) {
18381836
const createPrMutation =
1839-
`mutation createPr($branchName: String!, $id: String!, $commitMessage: String!, $defaultBranch: String!) {
1837+
`mutation createPr($branchName: String!, $id: ID!, $commitMessage: String!, $defaultBranch: String!) {
18401838
createPullRequest(input: {
18411839
baseRefName: $defaultBranch,
18421840
headRefName: $branchName,

lib/api-calls.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ async function getReposList(octokit, name, owner) {
55
q: `"${name}" user:${owner} in:file filename:package.json`
66
});
77

8-
let processedRepo = {};
8+
const processedRepo = {};
99
// filter() returns only the repos that are not present in processedRepo object, and adds them there to the list
10-
const deduplicatedReposList = items.filter(({ repository: { id }}) => !processedRepo[id] && (processedRepo[id] = true));
11-
12-
return deduplicatedReposList;
10+
return items.filter(({ repository: { id }}) => !processedRepo[id] && (processedRepo[id] = true));
1311
}
1412

1513
async function createPr(octokit, branchName, id, commitMessage, defaultBranch) {
1614
const createPrMutation =
17-
`mutation createPr($branchName: String!, $id: String!, $commitMessage: String!, $defaultBranch: String!) {
15+
`mutation createPr($branchName: String!, $id: ID!, $commitMessage: String!, $defaultBranch: String!) {
1816
createPullRequest(input: {
1917
baseRefName: $defaultBranch,
2018
headRefName: $branchName,

0 commit comments

Comments
 (0)