diff --git a/.changeset/eleven-dolphins-confess.md b/.changeset/eleven-dolphins-confess.md new file mode 100644 index 000000000..fb047c140 --- /dev/null +++ b/.changeset/eleven-dolphins-confess.md @@ -0,0 +1,5 @@ +--- +"@osdk/tool.release": minor +--- + +Prevent publishing patch from main and minor/major from release diff --git a/package.json b/package.json index 4cdd9c58d..3839edc23 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "check-mrl": "mrl check --verbose", "ci:publish": "pnpm run prePublish && pnpm publish -r --report-summary", "ci:publishSnapshot": "pnpm run prePublish && pnpm exec changeset version --snapshot && pnpm exec changeset publish --no-git-tag --snapshot --tag=next", - "ci:version": "pnpm exec changeset version && turbo run postVersioning && turbo codegen", "dev": "npx tsx packages/watch/src/watch.mts", "dev:typecheck": "npx tsx packages/watch/src/watch.mts", "lint": "turbo run lint", + "postVersionCmd": "turbo run postVersioning && turbo codegen", "prePublish": "turbo build && turbo lint", "prepare": "husky install", "test": "FORCE_COLOR=1 turbo run test", @@ -20,6 +20,7 @@ "devDependencies": { "@babel/core": "^7.24.4", "@babel/preset-typescript": "^7.23.3", + "@changesets/changelog-git": "^0.2.0", "@changesets/cli": "^2.26.2", "@monorepolint/cli": "0.5.0-alpha.108", "@monorepolint/config": "0.5.0-alpha.108", diff --git a/packages/tool.release/package.json b/packages/tool.release/package.json index 0e0f5f253..571a7f14e 100644 --- a/packages/tool.release/package.json +++ b/packages/tool.release/package.json @@ -23,11 +23,17 @@ "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo", "fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)", "lint": "eslint . && dprint check --config $(find-up dprint.json)", + "test": "vitest run --pool=forks", "transpile": "tsup", "typecheck": "tsc-absolute" }, "dependencies": { "@actions/exec": "^1.1.1", + "@changesets/apply-release-plan": "^7.0.0", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/changelog-git": "^0.2.0", + "@changesets/config": "^3.0.0", + "@changesets/git": "^3.0.0", "@changesets/pre": "^1.0.9", "@changesets/read": "^0.5.3", "@changesets/release-utils": "^0.2.0", diff --git a/packages/tool.release/src/FailedWithUserMessage.ts b/packages/tool.release/src/FailedWithUserMessage.ts new file mode 100644 index 000000000..35d7c1d57 --- /dev/null +++ b/packages/tool.release/src/FailedWithUserMessage.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class FailedWithUserMessage extends Error { + constructor(message: string) { + super(message); + this.name = "FailedWithUserMessage"; + } +} diff --git a/packages/tool.release/src/index.ts b/packages/tool.release/src/index.ts index 8ad047f54..b82666281 100644 --- a/packages/tool.release/src/index.ts +++ b/packages/tool.release/src/index.ts @@ -51,7 +51,8 @@ import { readChangesetState } from "@changesets/release-utils"; import { consola } from "consola"; import * as fs from "node:fs"; import yargs from "yargs"; -import { setupUser } from "./gitUtils.js"; +import { FailedWithUserMessage } from "./FailedWithUserMessage.js"; +import { checkIfClean as isGitClean, setupUser } from "./gitUtils.js"; import { runPublish } from "./runPublish.js"; import type { GithubContext } from "./runVersion.js"; import { runVersion } from "./runVersion.js"; @@ -86,13 +87,6 @@ async function getContext( }; } -class FailedWithUserMessage extends Error { - constructor(message: string) { - super(message); - this.name = "FailedWithUserMessage"; - } -} - (async () => { const args = await yargs(process.argv.slice(2)) .options({ @@ -101,14 +95,8 @@ class FailedWithUserMessage extends Error { choices: ["version", "publish"], default: "version", }, - versionCmd: { - type: "string", - conflicts: "publishCmd", - description: "Custom version command to run in version mode", - }, publishCmd: { type: "string", - conflicts: "versionCmd", description: "Publish command to run in publish mode", }, title: { type: "string", description: "Custom pr title" }, @@ -156,6 +144,12 @@ class FailedWithUserMessage extends Error { await setupUser(); } + if (!await isGitClean()) { + throw new FailedWithUserMessage( + "Your working directory is not clean. We are aborting for your protection.", + ); + } + const context = await getContext(args); const { changesets } = await readChangesetState(); @@ -176,7 +170,6 @@ class FailedWithUserMessage extends Error { } await runVersion({ - versionCmd: args.versionCmd, prTitle: args.title, commitMessage: args.commitMessage, branch: args.branch, diff --git a/packages/tool.release/src/mutateReleasePlan.test.ts b/packages/tool.release/src/mutateReleasePlan.test.ts new file mode 100644 index 000000000..2996a91dc --- /dev/null +++ b/packages/tool.release/src/mutateReleasePlan.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { ReleasePlan } from "@changesets/types"; +import { describe, expect, it } from "vitest"; +import { mutateReleasePlan } from "./mutateReleasePlan.js"; + +describe(mutateReleasePlan, () => { + describe("for main", () => { + it("promotes patches to minor", () => { + const plan: ReleasePlan = { + changesets: [ + { + id: "5", + releases: [ + { name: "foo", type: "patch" }, + ], + summary: "foo summary", + }, + ], + preState: undefined, + releases: [ + { + changesets: ["5"], + oldVersion: "2.1.3", + newVersion: "2.1.4", + name: "foo", + type: "patch", + }, + ], + }; + + mutateReleasePlan(plan, "main"); + + expect(plan).toEqual({ + changesets: [ + { + id: "5", + releases: [ + { name: "foo", type: "minor" }, + ], + summary: "foo summary", + }, + ], + preState: undefined, + releases: [ + { + changesets: ["5"], + oldVersion: "2.1.3", + newVersion: "2.2.0", + name: "foo", + type: "minor", + }, + ], + }); + }); + }); + + describe("for patch", () => { + it("fails to demote minor and major to patch", () => { + const plan: ReleasePlan = { + changesets: [ + { + id: "5", + releases: [ + { name: "foo", type: "minor" }, + ], + summary: "foo summary", + }, + ], + preState: undefined, + releases: [ + { + changesets: ["5"], + oldVersion: "2.1.3", + newVersion: "2.1.4", + name: "foo", + type: "minor", + }, + ], + }; + + expect(() => { + mutateReleasePlan(plan, "patch"); + }).toThrowErrorMatchingInlineSnapshot( + `[FailedWithUserMessage: Releasing requires converting a minor to a patch, but that may not be safe.]`, + ); + }); + }); +}); diff --git a/packages/tool.release/src/mutateReleasePlan.ts b/packages/tool.release/src/mutateReleasePlan.ts new file mode 100644 index 000000000..ce279765b --- /dev/null +++ b/packages/tool.release/src/mutateReleasePlan.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { ReleasePlan } from "@changesets/types"; +import { inc } from "semver"; +import { FailedWithUserMessage } from "./FailedWithUserMessage.js"; + +export function mutateReleasePlan( + releasePlan: ReleasePlan, + releaseType: "patch" | "main", +) { + for (const changeSet of releasePlan.changesets) { + for (const release of changeSet.releases) { + if (releaseType === "main" && release.type === "patch") { + release.type = "minor"; + } else if ( + releaseType === "patch" && (release.type !== "patch") + && (release.type !== "none") + ) { + throw new FailedWithUserMessage( + `Releasing requires converting a ${release.type} to a patch, but that may not be safe.`, + ); + } + } + } + + for (const q of releasePlan.releases) { + if (releaseType === "main" && q.type === "patch") { + q.type = "minor"; + q.newVersion = inc(q.oldVersion, "minor")!; + } + } +} diff --git a/packages/tool.release/src/runVersion.ts b/packages/tool.release/src/runVersion.ts index 61e603e95..0614c68d2 100644 --- a/packages/tool.release/src/runVersion.ts +++ b/packages/tool.release/src/runVersion.ts @@ -45,19 +45,27 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - import { exec } from "@actions/exec"; +import applyReleasePlan from "@changesets/apply-release-plan"; +import assembleReleasePlan from "@changesets/assemble-release-plan"; +import { read as readChangesetConfig } from "@changesets/config"; +import { getCurrentCommitId } from "@changesets/git"; +import { readPreState } from "@changesets/pre"; +import readChangesets from "@changesets/read"; import { getChangelogEntry, - readChangesetState, sortChangelogEntries, } from "@changesets/release-utils"; +import type { Config } from "@changesets/types"; +import { getPackages } from "@manypkg/get-packages"; +import { consola } from "consola"; import * as fs from "node:fs"; import path from "node:path"; import type { Octokit } from "octokit"; -import resolveFrom from "resolve-from"; import { createOrUpdatePr } from "./createOrUpdatePr.js"; +import { FailedWithUserMessage } from "./FailedWithUserMessage.js"; import * as gitUtils from "./gitUtils.js"; +import { mutateReleasePlan } from "./mutateReleasePlan.js"; import { getChangedPackages } from "./util/getChangedPackages.js"; import { getVersionPrBody } from "./util/getVersionPrBody.js"; import { getVersionsByDirectory } from "./util/getVersionsByDirectory.js"; @@ -76,7 +84,6 @@ export interface GithubContext { export const MAX_CHARACTERS_PER_MESSAGE = 60000; export type VersionOptions = { - versionCmd?: string; cwd?: string; prTitle?: string; commitMessage?: string; @@ -84,37 +91,97 @@ export type VersionOptions = { prBodyMaxCharacters?: number; branch?: string; context: GithubContext; + snapshot?: string | boolean; }; export async function runVersion({ - versionCmd, cwd = process.cwd(), prTitle = "Version Packages", commitMessage = "Version Packages", hasPublishScript = false, prBodyMaxCharacters = MAX_CHARACTERS_PER_MESSAGE, context, + snapshot, }: VersionOptions): Promise { const { branch } = context; + + if (branch.startsWith("changeset-release/")) { + throw new FailedWithUserMessage( + "This branch is already a version branch, aborting", + ); + } + + const isMainBranch = context.branch === "main" + || process.env.PRETEND_BRANCH === "main"; + const isReleaseBranch = context.branch.startsWith("release/") + || process.env.PRETEND_BRANCH?.startsWith("release/"); + + const runGitCommands = !process.env.PRETEND_BRANCH; + + if (!isMainBranch && !isReleaseBranch) { + throw new FailedWithUserMessage( + "You must use a main or release branch.\n\n(You can fake it by setting the env variable PRETEND_BRANCH", + ); + } + const versionBranch = `changeset-release/${branch}`; - const { preState } = await readChangesetState(cwd); - await gitUtils.switchToMaybeExistingBranch(versionBranch); - await gitUtils.reset(context.sha); + if (!runGitCommands) { + consola.warn("Skipping checkout due to using a pretend branch"); + } else { + await gitUtils.switchToMaybeExistingBranch(versionBranch); + await gitUtils.reset(context.sha); + } const originalVersionsByDirectory = await getVersionsByDirectory(cwd); - if (versionCmd) { - const [versionCommand, ...versionArgs] = versionCmd.split(/\s+/); - await exec(versionCommand, versionArgs, { cwd }); - } else { - await exec( - "node", - [resolveFrom(cwd, "@changesets/cli/bin.js"), "version"], - { cwd }, + const packages = await getPackages(cwd); + const config = await readChangesetConfig(cwd, packages); + + const [changesets, preState] = await Promise.all([ + readChangesets.default(cwd), + readPreState(cwd), + ]); + + const releaseConfig: Config = { + ...config, + // Disable committing when in snapshot mode + commit: snapshot || !runGitCommands ? false : config.commit, + changelog: ["@changesets/changelog-git", null], + }; + + const releasePlan = assembleReleasePlan( + changesets, + packages, + releaseConfig, + preState, + snapshot + ? { + tag: snapshot === true ? undefined : snapshot, + commit: config.snapshot.prereleaseTemplate?.includes("{commit}") + ? await getCurrentCommitId({ cwd }) + : undefined, + } + : undefined, + ); + + mutateReleasePlan(releasePlan, isMainBranch ? "main" : "patch"); + + const touchedFiles = await applyReleasePlan( + releasePlan, + packages, + releaseConfig, + snapshot, + ); + + if (touchedFiles.length === 0) { + throw new FailedWithUserMessage( + "No changesets to apply, aborting", ); } + await exec("pnpm", ["run", "postVersionCmd"], { cwd }); + const changedPackagesInfo = await getSortedChangedPackagesInfo( cwd, originalVersionsByDirectory, @@ -122,31 +189,35 @@ export async function runVersion({ const finalPrTitle = `${prTitle}${!!preState ? ` (${preState.tag})` : ""}`; - // project with `commit: true` setting could have already committed files - if (!(await gitUtils.checkIfClean())) { - const finalCommitMessage = `${commitMessage}${ - !!preState ? ` (${preState.tag})` : "" - }`; - await gitUtils.commitAll(finalCommitMessage); - } + if (!runGitCommands) { + consola.warn("Skipping: commit, push, createPr"); + } else { + // project with `commit: true` setting could have already committed files + if (!(await gitUtils.checkIfClean())) { + const finalCommitMessage = `${commitMessage}${ + !!preState ? ` (${preState.tag})` : "" + }`; + await gitUtils.commitAll(finalCommitMessage); + } - await gitUtils.push(versionBranch, { force: true }); + await gitUtils.push(versionBranch, { force: true }); - const prBody = await getVersionPrBody({ - hasPublishScript, - preState, - branch, - changedPackagesInfo, - prBodyMaxCharacters, - }); - - await createOrUpdatePr( - context, - finalPrTitle, - prBody, - branch, - versionBranch, - ); + const prBody = await getVersionPrBody({ + hasPublishScript, + preState, + branch, + changedPackagesInfo, + prBodyMaxCharacters, + }); + + await createOrUpdatePr( + context, + finalPrTitle, + prBody, + branch, + versionBranch, + ); + } } async function getSortedChangedPackagesInfo( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad55d281e..66f04b446 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: '@babel/preset-typescript': specifier: ^7.23.3 version: 7.23.3(@babel/core@7.24.4) + '@changesets/changelog-git': + specifier: ^0.2.0 + version: 0.2.0 '@changesets/cli': specifier: ^2.26.2 version: 2.26.2 @@ -1112,6 +1115,21 @@ importers: '@actions/exec': specifier: ^1.1.1 version: 1.1.1 + '@changesets/apply-release-plan': + specifier: ^7.0.0 + version: 7.0.0 + '@changesets/assemble-release-plan': + specifier: ^6.0.0 + version: 6.0.0 + '@changesets/changelog-git': + specifier: ^0.2.0 + version: 0.2.0 + '@changesets/config': + specifier: ^3.0.0 + version: 3.0.0 + '@changesets/git': + specifier: ^3.0.0 + version: 3.0.0 '@changesets/pre': specifier: ^1.0.9 version: 1.0.14 @@ -1636,6 +1654,24 @@ packages: semver: 7.6.0 dev: true + /@changesets/apply-release-plan@7.0.0: + resolution: {integrity: sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==} + dependencies: + '@babel/runtime': 7.24.0 + '@changesets/config': 3.0.0 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.0 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.8 + resolve-from: 5.0.0 + semver: 7.6.0 + dev: false + /@changesets/assemble-release-plan@5.2.4: resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} dependencies: @@ -1647,12 +1683,28 @@ packages: semver: 7.6.0 dev: true + /@changesets/assemble-release-plan@6.0.0: + resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} + dependencies: + '@babel/runtime': 7.24.0 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + semver: 7.6.0 + dev: false + /@changesets/changelog-git@0.1.14: resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} dependencies: '@changesets/types': 5.2.1 dev: true + /@changesets/changelog-git@0.2.0: + resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} + dependencies: + '@changesets/types': 6.0.0 + /@changesets/cli@2.26.2: resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} hasBin: true @@ -1704,6 +1756,18 @@ packages: micromatch: 4.0.5 dev: true + /@changesets/config@3.0.0: + resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.0.0 + '@changesets/logger': 0.1.0 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.5 + dev: false + /@changesets/errors@0.1.4: resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} dependencies: @@ -1725,6 +1789,16 @@ packages: semver: 7.6.0 dev: true + /@changesets/get-dependents-graph@2.0.0: + resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} + dependencies: + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + chalk: 2.4.2 + fs-extra: 7.0.1 + semver: 7.6.0 + dev: false + /@changesets/get-release-plan@3.0.17: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: @@ -1741,6 +1815,10 @@ packages: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} dev: true + /@changesets/get-version-range-type@0.4.0: + resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} + dev: false + /@changesets/git@2.0.0: resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} dependencies: @@ -4891,7 +4969,6 @@ packages: /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} - dev: true /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -6861,7 +6938,6 @@ packages: /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - dev: true /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -7473,7 +7549,6 @@ packages: /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - dev: true /outvariant@1.4.2: resolution: {integrity: sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==} @@ -7866,7 +7941,6 @@ packages: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true - dev: true /prettier@3.2.5: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} diff --git a/scripts/createReleasePr.sh b/scripts/createReleasePr.sh index fb027e2b7..e6d69bf22 100755 --- a/scripts/createReleasePr.sh +++ b/scripts/createReleasePr.sh @@ -13,20 +13,6 @@ if [[ $(git rev-parse --abbrev-ref HEAD | sed -E 's/^changeset-release\/.*$/ABOR exit 1 fi - -if output=$(git status --porcelain) && [ -z "$output" ]; then - # Working directory clean - - pnpm exec turbo transpile --filter "./packages/tool.release" - node ./packages/tool.release/build/js/index.mjs --repo palantir/osdk-ts --versionCmd "pnpm ci:version" - echo - echo - echo "WARNING: You are on the release branch" -else - # Uncommitted changes - echo "===== ABORTING =====" - echo "" - echo "For your protection, we are aborting the createReleasePr flow as you have" - echo "unmerged changes in your tree." - exit 1 -fi \ No newline at end of file +pnpm exec turbo transpile --filter "./packages/tool.release" +node ./packages/tool.release/build/js/index.mjs --repo palantir/osdk-ts +echo "WARNING: You are probably on the pr branch"