Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EIP number auto-assign algorithm #344

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions src/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,28 @@ async function generateEIPNumber(octokit: Octokit, repository: Repository, front
}

// Get all EIPs
const eips = ((await octokit.rest.repos.getContent({
owner: repository.owner.login,
repo: repository.name,
path: 'EIPS'
})).data as any[]).concat((await octokit.rest.repos.getContent({
owner: repository.owner.login,
repo: repository.name,
path: 'ERCS'
})).data as any[]);
// TODO: This should not be hardcoded
const eipPathConfigs = [
{
owner: 'ethereum',
repo: 'EIPs',
path: 'EIPS'
},
{
owner: 'ethereum',
repo: 'ERCs',
path: 'ERCS'
},
];
const eips = [];
for (let eipPathConfig in eipPathConfigs) {
const { data } = await octokit.rest.repos.getContent({
owner: repository.owner.login,
repo: repository.name,
path: 'EIPS'
});
eips.concat(data);
}

// Get all EIP numbers
const eipNumbers = eips
Expand Down