diff --git a/bin/set-major-version-tag.js b/bin/set-major-version-tag.js index 2b42e331c..af9cdb367 100755 --- a/bin/set-major-version-tag.js +++ b/bin/set-major-version-tag.js @@ -37,18 +37,12 @@ async function runGitCmd(args) { */ async function setMajorVersionTag() { try { - console.log( - 'kanad test', - JSON.stringify({ - GITHUB_BASE_REF: process.env.GITHUB_BASE_REF, - GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF, - GITHUB_REF: process.env.GITHUB_REF, - GITHUB_REF_NAME: process.env.GITHUB_REF_NAME, - GITHUB_REF_PROTECTED: process.env.GITHUB_REF_PROTECTED, - GITHUB_REF_TYPE: process.env.GITHUB_REF_TYPE, - GITHUB_WORKFLOW_REF: process.env.GITHUB_WORKFLOW_REF, - }), - ); + // The major version tag should only be set when releasing on the `main` branch + if (process.env.GITHUB_REF !== 'refs/heads/main') { + // eslint-disable-next-line no-console + console.warn(`Running with the following ref: ${process.env.GITHUB_REF || 'n/a'}, not setting major version tag`); + return; + } const parsedVersion = parse(pkg.version);