mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
ci: Add github action to make sure changelog for @excalidraw/excalidraw is updated (#2518)
Add guidelines for changelog and group the commits update the changelog with the latest commits since the last release Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
parent
81c17a56fb
commit
59cff0f219
4 changed files with 95 additions and 3 deletions
34
scripts/changelog-check.js
Normal file
34
scripts/changelog-check.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const { exec } = require("child_process");
|
||||
|
||||
const changeLogCheck = () => {
|
||||
exec(
|
||||
"git diff origin/master --cached --name-only",
|
||||
(error, stdout, stderr) => {
|
||||
if (error || stderr) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!stdout || stdout.includes("packages/excalidraw/CHANGELOG.MD")) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const onlyNonSrcFilesUpdated = stdout.indexOf("src") < 0;
|
||||
if (onlyNonSrcFilesUpdated) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const changedFiles = stdout.trim().split("\n");
|
||||
const filesToIgnoreRegex = /src\/excalidraw-app|packages\/utils/;
|
||||
|
||||
const excalidrawPackageFiles = changedFiles.filter((file) => {
|
||||
return file.indexOf("src") >= 0 && !filesToIgnoreRegex.test(file);
|
||||
});
|
||||
|
||||
if (excalidrawPackageFiles.length) {
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(0);
|
||||
},
|
||||
);
|
||||
};
|
||||
changeLogCheck();
|
Loading…
Add table
Add a link
Reference in a new issue