diff --git a/dist/version/index.js b/dist/version/index.js index 4c92549..9451a7f 100644 --- a/dist/version/index.js +++ b/dist/version/index.js @@ -96106,7 +96106,7 @@ async function version({ packagesCsv = core.getInput(constants_1.Input.Packages, await (0, strategy_1.validateAllowedStrategies)({ packages, versionStrategy }); const client = github.getOctokit(token); const defaultBranch = await (0, github_1.getDefaultBranch)({ client, repo }); - if (baseBranch && baseBranch !== defaultBranch && (0, strategy_1.canUseFromNonDefaultBranch)(versionStrategy)) { + if (baseBranch && baseBranch !== defaultBranch && !(0, strategy_1.canUseFromNonDefaultBranch)(versionStrategy)) { core.setFailed(`Version strategy ${versionStrategy} cannot be used from a non-default branch`); return; } diff --git a/src/version.ts b/src/version.ts index 481fb1e..799682a 100644 --- a/src/version.ts +++ b/src/version.ts @@ -76,7 +76,7 @@ export default async function version({ const client = github.getOctokit(token) const defaultBranch = await getDefaultBranch({ client, repo }) - if (baseBranch && baseBranch !== defaultBranch && canUseFromNonDefaultBranch(versionStrategy)) { + if (baseBranch && baseBranch !== defaultBranch && !canUseFromNonDefaultBranch(versionStrategy)) { core.setFailed(`Version strategy ${versionStrategy} cannot be used from a non-default branch`) return }