Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 9 additions & 0 deletions .changeset/lemon-garlics-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@changesets/action": patch
---

fix: cwd now works again with relative paths and commitMode: git-cli
Comment thread
Andarist marked this conversation as resolved.
Outdated

v1.5.2 introduced a bug where specifying `cwd`
when using the default `commitMode` would break things,
as it tried to resolve the path twice.
Comment thread
Andarist marked this conversation as resolved.
Outdated
7 changes: 7 additions & 0 deletions .changeset/sour-elephants-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@changesets/action": patch
---

Update @changesets/ghcommit, and avoid calling `process.chdir()`

fixes #475
Comment thread
Andarist marked this conversation as resolved.
Outdated
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.1",
"@changesets/ghcommit": "1.4.0",
"@changesets/ghcommit": "^2.0.0",
"@changesets/pre": "^1.0.9",
"@changesets/read": "^0.5.3",
"@manypkg/get-packages": "^1.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class Git {
base: {
commit: github.context.sha,
},
addFromDirectory,
cwd: this.cwd,
force: true,
});
}
Expand Down
8 changes: 2 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as core from "@actions/core";
import fs from "node:fs/promises";
import path from "node:path";
import { Git } from "./git";
import { setupOctokit } from "./octokit";
import readChangesetState from "./readChangesetState";
Expand All @@ -16,12 +17,7 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
return;
}

const inputCwd = getOptionalInput("cwd");
if (inputCwd) {
core.info("changing directory to the one given as the input");
process.chdir(inputCwd);
}
const cwd = inputCwd || process.cwd();
const cwd = path.resolve(getOptionalInput("cwd") ?? "");
Comment thread
s0 marked this conversation as resolved.

const octokit = setupOctokit(githubToken);
const commitMode = getOptionalInput("commitMode") ?? "git-cli";
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
resolved "https://registry.yarnpkg.com/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz#8131a99035edd11aa7a44c341cbb05e668618c67"
integrity sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==

"@changesets/ghcommit@1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@changesets/ghcommit/-/ghcommit-1.4.0.tgz#61a8bcdad1e78140ad69b6c6980e9c82471c8993"
integrity sha512-gG4QZsMwply4wFxqjfO7oI70lAb579zRbKB2EgjkVo+olWzXvmcQb52zkLpL3L9+QrAGD0QP8fNER9Wn3CmcHw==
"@changesets/ghcommit@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@changesets/ghcommit/-/ghcommit-2.0.0.tgz#a3d8f733ad7ec9bb1f17c7dc0b64c3f62636305f"
integrity sha512-UFS7mCjh3B8KfiDQi6JbZNDoANdTqLgBKHCwMASZ25A3yfxaFVKURGzwdMdlcYx5k6dHN1igDHzgXuwOyZ9xKg==
dependencies:
isomorphic-git "^1.27.1"

Expand Down