-
Notifications
You must be signed in to change notification settings - Fork 1
chore: add post commit script #96
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
Conversation
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.
Pull Request Overview
This PR adds a new post-commit script to automate changeset markdown creation after commits. Key changes include:
- Implementing functions to obtain the last commit details (ID, message, and file list).
- Parsing workspace packages from a YAML file and linking committed files to their respective workspace.
- Composing and writing a changeset markdown file, then auto-committing the changes.
Files not reviewed (2)
- package.json: Language not supported
- pnpm-lock.yaml: Language not supported
const lastCommitMessage = await getLastCommitMessage() | ||
const matchedChangeset = await getMatchedChangeset(lastCommitMessage) | ||
if (!matchedChangeset) | ||
return console.warn(`The commit message "${lastCommitMessage}" does not match any angular changeset type.`) |
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.
The warning message incorrectly refers to 'angular changeset type'. Consider updating it to reflect the general changeset logic used by the script.
return console.warn(`The commit message "${lastCommitMessage}" does not match any angular changeset type.`) | |
return console.warn(`The commit message "${lastCommitMessage}" does not match any recognized changeset type.`) |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
scripts/post-commit.ts
Outdated
|
||
console.log(`${workspaceCommittedFiles.map(v => k.dim(`${k.green(`[${v.workspace ? '✓' : '✗'}]`)} ${path.relative(process.cwd(), v.filePath)}: detected workspace: ${v.workspace?.folderPath ? path.relative(process.cwd(), v.workspace.folderPath) : 'null'}`)).join('\n')}`) | ||
if (workspaceCommittedFiles.every(v => v.workspace === null)) | ||
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has not files in the workspace.`)) |
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.
The warning message contains a grammatical error ('has not files'); consider changing it to 'has no files'.
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has not files in the workspace.`)) | |
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has no files in the workspace.`)) |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
No description provided.