-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fixes for auto-numbering of MIPs #45
Conversation
Update the template with the right placeholder string that the action will replace with the appropriate MIP number. Also retroactively applies the new format to existing MIPs.
Add file naming guidelines
improves frontmatter and includes an update to the regular expression that will be used to automatically set MIP numbers.
These changes ensures that automatic MIP numbering can be applied to multiple mip-x.md files with each merged PR. Multiple files can be specified as "mip-x.md", mip-x-foo.md", and "mip-x-bar.md". If the current MIP number was 10, these would be renamed to: mip-10.md, mip-11.md, mip-12.md, respectively.
Added some adjustments that intend to enable the script to accept PRs with multiple MIP files. I figured we might as well make automatic MIP number assignment flexible to allow for multiple MIPs to come through in one PR. |
|
||
const oldFilePath = path.join(MIPsFolderPath, "mip-x.md"); | ||
const newFilePath = path.join(MIPsFolderPath, `mip-${nextMIPNumber}.md`); | ||
const oldFilePath = path.join(MIPsFolderPath, "mip-x.md"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully understanding how this script is able to assign multiple mip file names if this loop is hardcoded to only target mip-x.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I attempted to make some changes to match on files matching the pattern mip-x*.md and then apply the automatic numbering to them.
remove and exclude in .gitignore
Delete .DS_Store
Iterates through the mip-x*.md files and applies automatic numbering to them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this template change would have come in a separate PR before this one, but not that big of a deal
|
||
execSync(`git add ${oldFilePath} ${newFilePath}`); | ||
execSync(`git add "${oldFilePath}" "${newFilePath}"`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wrapped these paths in quotes to ensure whitespace doesn't break the command
Update the template with the right placeholder string that the action will replace with the appropriate MIP number.
Also retroactively applies the new format to existing MIPs.