From 5110bb80aa6007617e8ecc8c4500cd137090af13 Mon Sep 17 00:00:00 2001 From: Tomas Madariaga Date: Tue, 12 May 2026 11:16:03 +0200 Subject: [PATCH] feat(packages/sui-mono): add --skip-checks flag to release command Co-Authored-By: Claude Sonnet 4.6 --- packages/sui-mono/README.md | 18 ++++++++++++++++++ packages/sui-mono/bin/sui-mono-release.js | 13 ++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/sui-mono/README.md b/packages/sui-mono/README.md index 18de6b785..2f0a6a080 100644 --- a/packages/sui-mono/README.md +++ b/packages/sui-mono/README.md @@ -172,6 +172,24 @@ If you want the `package-lock.json` to be committed once the packages are releas sui-mono release --lock ``` +To append `[skip ci]` to release commit messages (skips CI pipeline for the release commits): + +```sh +sui-mono release --skip-ci +``` + +To append a `skip-checks: true` trailer to release commit messages (skips GitHub branch protection check runs): + +```sh +sui-mono release --skip-checks +``` + +Both flags can be combined: + +```sh +sui-mono release --skip-ci --skip-checks +``` + ## How to configure your project First you need to install the `@s-ui/mono` package in your project diff --git a/packages/sui-mono/bin/sui-mono-release.js b/packages/sui-mono/bin/sui-mono-release.js index 698e5fe34..0408e4055 100644 --- a/packages/sui-mono/bin/sui-mono-release.js +++ b/packages/sui-mono/bin/sui-mono-release.js @@ -17,6 +17,7 @@ program .option('-E, --github-email ', 'github email') .option('-L, --lock', 'Commit lock file', false) .option('--skip-ci', 'Add [skip ci] to release commit message', false) + .option('--skip-checks', 'Add skip-checks: true trailer to release commit message', false) .on('--help', () => { console.log(' Description:') console.log('') @@ -39,7 +40,7 @@ program }) .parse(process.argv) -const {scope: packageScope, githubEmail, githubToken, githubUser, lock, skipCi} = program.opts() +const {scope: packageScope, githubEmail, githubToken, githubUser, lock, skipCi, skipChecks} = program.opts() const BASE_DIR = process.cwd() @@ -69,7 +70,7 @@ const getCwd = ({pkg}) => { return isMonoPackage ? BASE_DIR : path.join(process.cwd(), pkg) } -const commit = async ({pkg, code, skipCi}) => { +const commit = async ({pkg, code, skipCi, skipChecks}) => { const isMonoPackage = checkIsMonoPackage() const cwd = getCwd({pkg}) @@ -84,8 +85,10 @@ const commit = async ({pkg, code, skipCi}) => { // Add [skip ci] to the commit message to avoid CI build // https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build const skipCiSuffix = skipCi ? ' [skip ci]' : '' - const commitMsg = `release(${packageScope}): v${version}${skipCiSuffix}` - await exec(`git commit -m "${commitMsg}"`, {cwd}) + const skipChecksSuffix = skipChecks ? '\n\n\nskip-checks: true' : '' + const commitMsg = `release(${packageScope}): v${version}${skipCiSuffix}${skipChecksSuffix}` + const cleanupFlag = skipChecks ? ' --cleanup=verbatim' : '' + await exec(`git commit -m "${commitMsg}"${cleanupFlag}`, {cwd}) await exec(`${suiMonoBinPath} changelog ${cwd}`) await exec(`git add ${path.join(cwd, changelogFilename)}`, {cwd}) @@ -163,7 +166,7 @@ checkShouldRelease() const packagesToRelease = releasesByPackages({status}).filter(({code}) => code !== 0) for (const pkg of packagesToRelease) { - await commit({...pkg, skipCi}) + await commit({...pkg, skipCi, skipChecks}) } if (packagesToRelease.length > 0) {