Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building commit file path from repo root instead of execution dir #2456

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/core/src/git.ts
Expand Up @@ -11,6 +11,7 @@
import join from "url-join";
import { gt, lt } from "semver";
import prettyMs from "pretty-ms";
import { execSync } from "child_process";

import { Memoize as memoize } from "typescript-memoize";

Expand Down Expand Up @@ -379,13 +380,17 @@
includeMergeCommitFiles: true,
});

const repoRootPath = execSync("git rev-parse --show-toplevel", {
encoding: "utf8",
}).trim();

return log
.map((commit) => ({
hash: commit.hash,
authorName: commit.authorName,
authorEmail: commit.authorEmail,
subject: commit.rawBody!,
files: (commit.files || []).map((file) => path.resolve(file)),
files: (commit.files || []).map((file) => path.resolve(repoRootPath,file)),
}))
.reduce<ICommit[]>((all, commit) => {
// The -m option will list a commit for each merge parent. This
Expand Down Expand Up @@ -852,7 +857,7 @@
}

/** Create a release for the GitHub project */
async publish(

Check warning on line 860 in packages/core/src/git.ts

View workflow job for this annotation

GitHub Actions / lint

Async method 'publish' has too many parameters (5). Maximum allowed is 4
releaseNotes: string,
tag: string,
prerelease = false,
Expand Down