Skip to content

Commit eff3c7a

Browse files
authored
Fix EIP number auto-assign algorithm (#344)
Signed-off-by: Gavin John <[email protected]>
1 parent aacaa41 commit eff3c7a

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

src/merge.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,28 @@ async function generateEIPNumber(octokit: Octokit, repository: Repository, front
4040
}
4141

4242
// Get all EIPs
43-
const eips = ((await octokit.rest.repos.getContent({
44-
owner: repository.owner.login,
45-
repo: repository.name,
46-
path: 'EIPS'
47-
})).data as any[]).concat((await octokit.rest.repos.getContent({
48-
owner: repository.owner.login,
49-
repo: repository.name,
50-
path: 'ERCS'
51-
})).data as any[]);
43+
// TODO: This should not be hardcoded
44+
const eipPathConfigs = [
45+
{
46+
owner: 'ethereum',
47+
repo: 'EIPs',
48+
path: 'EIPS'
49+
},
50+
{
51+
owner: 'ethereum',
52+
repo: 'ERCs',
53+
path: 'ERCS'
54+
},
55+
];
56+
const eips = [];
57+
for (let eipPathConfig in eipPathConfigs) {
58+
const { data } = await octokit.rest.repos.getContent({
59+
owner: repository.owner.login,
60+
repo: repository.name,
61+
path: 'EIPS'
62+
});
63+
eips.concat(data);
64+
}
5265

5366
// Get all EIP numbers
5467
const eipNumbers = eips

0 commit comments

Comments
 (0)