How to use the @semantic-release/commit-analyzer function in @semantic-release/commit-analyzer

To help you get started, we’ve selected a few @semantic-release/commit-analyzer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages-utils / webiny-semantic-release / src / plugins / analyzeCommits / index.js View on Github external
const commits = await getCommits(lastRelease.gitHead, config.branch, logger);
            const relevantCommits = getRelevantCommits(commits, pkg);

            // Store relevant commits for later use
            packages[i].commits = relevantCommits;

            // Store lastRelease for later use
            packages[i]["lastRelease"] = lastRelease;

            if (!relevantCommits.length) {
                logger.log(`No relevant commits were found for package %s`, pkg.name);
                logger.log(`======== Finished processing package ========\n\n`);
                continue;
            }

            const type = await commitAnalyzer(
                pluginConfig.analyzeCommits || {},
                Object.assign({ logger, commits: relevantCommits })
            );
            relevantCommits.length &&
                logger.log(
                    `Relevant commits:\n* ${relevantCommits.map(c => c.subject).join("\n* ")}`
                );
            let version;
            if (lastRelease.version) {
                version = semver.inc(lastRelease.version, type);
                logger.log("The next release version is %s", version);
            } else {
                version = "1.0.0";
                logger.log("There is no previous release, the next release version is %s", version);
            }
            packages[i]["nextRelease"] = {

@semantic-release/commit-analyzer

semantic-release plugin to analyze commits with conventional-changelog

MIT
Latest version published 7 months ago

Package Health Score

84 / 100
Full package analysis