MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / validateChangesets

Function validateChangesets

scripts/version-alpha.ts:62–82  ·  view source on GitHub ↗

* Validate that the changesets meet our rules for an Alpha release * changeset, logging and killing the script otherwise. * * The validations are: * - no major or minor changesets are allowed

(changesets)

Source from the content-addressed store, hash-verified

60 * - no major or minor changesets are allowed
61 */
62function validateChangesets(changesets) {
63 if (changesets.length === 0) {
64 console.log("No new changesets found.");
65 process.exit(0);
66 }
67
68 let validationFailed = false;
69
70 for (const { frontMatter, path: changesetPath } of changesets) {
71 if (/: (major|minor)\s*$/m.test(frontMatter)) {
72 validationFailed = true;
73 console.log(
74 `Error: ${changesetPath}: No "major" or "minor" changesets are allowed in Alpha`,
75 );
76 }
77 }
78
79 if (validationFailed) {
80 process.exit(1);
81 }
82}
83
84/**
85 * Checks whether a new changeset should be created for the package.

Callers 1

versionAlphaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected