Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"prettier": "prettier --write 'src/**/*.ts'",
"test": "vitest",
"test-ci": "pnpm build && pnpm test",
"watch": "pnpm build -- --watch"
"watch": "pnpm build --watch"
},
"prettier": {
"arrowParens": "avoid",
Expand All @@ -48,10 +48,12 @@
"make-fetch-happen": "^9.0.0",
"p-map": "^3.0.0",
"progress": "^2.0.0",
"semver": "^7.7.2",
"yargs": "^17.1.0"
},
"devDependencies": {
"@types/node": "22.10.10",
"@types/semver": "^7.7.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.55.0",
Expand Down
44 changes: 25 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as Git from "./git";
import GithubAPI, { GitHubUserResponse } from "./github-api";
import { CommitInfo, Release } from "./interfaces";
import MarkdownRenderer from "./markdown-renderer";
import { prerelease } from "semver";

const UNRELEASED_TAG = "___unreleased___";

Expand Down Expand Up @@ -158,7 +159,8 @@ export default class Changelog {
tagsInCommit = refName
.split(", ")
.filter(ref => ref.startsWith(TAG_PREFIX))
.map(ref => ref.substr(TAG_PREFIX.length));
.map(ref => ref.substr(TAG_PREFIX.length))
.filter(ref => !prerelease(ref));
}

const issueNumber = findPullRequestId(message);
Expand Down
3 changes: 1 addition & 2 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function listTagNames(): string[] {
* The latest reachable tag starting from HEAD
*/
export function lastTag(): string {
return execa.sync("git", ["describe", "--abbrev=0", "--tags"]).stdout;
return execa.sync("git", ["describe", "--abbrev=0", "--tags", "--first-parent"]).stdout;
}

export interface CommitListItem {
Expand Down Expand Up @@ -55,7 +55,6 @@ export function listCommits(from: string, to: string = ""): CommitListItem[] {
"--oneline",
"--pretty=hash<%h> ref<%D> message<%s> date<%cd>",
"--date=short",
"--first-parent",
`${from}..${to}`,
])
.stdout.split("\n")
Expand Down
11 changes: 3 additions & 8 deletions tests/basic-acceptance.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,18 @@ describe("command line interface", () => {

expect(stdout).toMatchInlineSnapshot(`
"
## Unreleased (2025-03-05)
## Unreleased (2025-06-16)

#### :rocket: Enhancement
* \`github-changelog\`
* [#33](https://github.com/embroider-build/github-changelog/pull/33) support github enterpise url detection and env vars ([@patricklx](https://github.com/patricklx))

#### Committers: 1
- Patrick Pircher ([@patricklx](https://github.com/patricklx))


## v1.1.0-github-changelog (2025-01-25)

#### :house: Internal
* \`github-changelog\`
* [#29](https://github.com/embroider-build/github-changelog/pull/29) Prepare Release ([@github-actions[bot]](https://github.com/apps/github-actions))

#### Committers: 1
#### Committers: 2
- Patrick Pircher ([@patricklx](https://github.com/patricklx))
- [@github-actions[bot]](https://github.com/apps/github-actions)"
`);
});
Expand Down