Skip to content
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

Feat!: automatic-versioning - invalidate turbo cache #125

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/automatic-versioning/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const defaultRootDir = "../../../../";
opts.root ??= defaultRootDir;
opts.ignorePrefixes = opts.ignorePrefixes?.split(",") ?? [];

console.log(`Running versioning script for ${opts.name}`.green);
console.info(`Running versioning script for ${opts.name}`.green);

if (opts.root !== defaultRootDir) {
const parentDir = path.resolve(__dirname, opts.root);
Expand Down
12 changes: 6 additions & 6 deletions packages/automatic-versioning/src/types/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getCommitPrefix = async (recursive, ignorePrefixes, n = 1) => {
const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBranch, ignorePrefixes) => {
run("git show --first-parent ./").then(async (diff) => {
if (diff) {
console.log(`Diff found, running versioning for ${name}`.green);
console.info(`Diff found, running versioning for ${name}`.green);
const { commitMessage, commitPrefix, noBump } = await getCommitPrefix(recursive, ignorePrefixes);
if (!noBump) {
let versionUpdate;
Expand All @@ -35,7 +35,7 @@ const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBran
} else if (["prerelease", "prepatch", "preminor", "premajor"].includes(commitPrefix)) {
versionUpdate = commitPrefix;
} else {
console.log(`No suitable commit prefix found in commit message, skipping version bump`.yellow);
console.info(`No suitable commit prefix found in commit message, skipping version bump`.yellow);
return;
}
if (prereleaseBranch && ["major", "minor", "patch"].includes(versionUpdate)) {
Expand Down Expand Up @@ -84,19 +84,19 @@ const runner = (name, noCommit, recursive = false, prereleaseTag, prereleaseBran
}"`;
run("git add .").then(() => {
run(`git commit -m ${successMsg} --no-verify`).then(() => {
console.log(successMsg.green);
console.info(successMsg.green);
});
});
}
});
} else {
console.log(`No bump found in commit message, skipping version bump and editing commit message`.yellow);
console.info(`No bump found in commit message, skipping version bump and editing commit message`.yellow);
run(`git commit --amend -m "${commitMessage.replace(/--no-bump/g, "")}"`).then(() => {
console.log("Successfully edited commit message".green);
console.info("Successfully edited commit message".green);
});
}
} else {
console.log(`No diff found, skipping version bump for ${name}`.yellow);
console.info(`No diff found, skipping version bump for ${name}`.yellow);
}
});
};
Expand Down
4 changes: 2 additions & 2 deletions packages/automatic-versioning/src/types/tag-based.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const runner = (name, noCommit) => {
const successMsg = `"CI: Bumped version of ${name} from ${initialVersion} to ${latest}"`;
run("git add .").then(() => {
run(`git commit -m ${successMsg}`).then(() => {
console.log(successMsg.green);
console.info(successMsg.green);
});
});
}
})
.catch(() => {});
} else {
console.log(`No tag diff found, skipping version bump for ${name}`.yellow);
console.info(`No tag diff found, skipping version bump for ${name}`.yellow);
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/automatic-versioning/src/utils/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const executor = (command) => {
return resolve(output);
})
.catch((error) => {
if (error) console.log(error.red);
if (error) console.error(error.red);
return reject(error);
});
});
Expand Down