Skip to content

Commit 9917dab

Browse files
committed
fix: fix the go workspace version matching
1 parent 23cddad commit 9917dab

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

__snapshots__/go-workspace.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Release notes for path: packages/goA, releaseType: go
2222
### Dependencies
2323
2424
* The following workspace dependencies were updated
25-
* example.com/packages/goB/v2 bumped from 2.2.2 to 2.2.3
25+
* example.com/packages/goB/v2 bumped from 2.2.2-0.20250203122516-4c838e530ecb to 2.2.3
2626
</details>
2727
2828
<details><summary>example.com/packages/goE: 3.3.4</summary>
@@ -66,7 +66,7 @@ Release notes for path: packages/goB, releaseType: go
6666
### Dependencies
6767
6868
* The following workspace dependencies were updated
69-
* example.com/packages/goB/v2 bumped from 2.2.2 to 2.3.0
69+
* example.com/packages/goB/v2 bumped from 2.2.2-0.20250203122516-4c838e530ecb to 2.3.0
7070
</details>
7171
7272
---
@@ -96,7 +96,7 @@ Release notes for path: packages/goA, releaseType: go
9696
### Dependencies
9797
9898
* The following workspace dependencies were updated
99-
* example.com/packages/goB/v2 bumped from 2.2.2 to 2.2.3
99+
* example.com/packages/goB/v2 bumped from 2.2.2-0.20250203122516-4c838e530ecb to 2.2.3
100100
</details>
101101
102102
<details><summary>example.com/packages/goD: 4.4.5</summary>
@@ -139,7 +139,7 @@ Release notes for path: packages/goA, releaseType: go
139139
### Dependencies
140140
141141
* The following workspace dependencies were updated
142-
* example.com/packages/goB/v2 bumped from 2.2.2 to 2.2.3
142+
* example.com/packages/goB/v2 bumped from 2.2.2-0.20250203122516-4c838e530ecb to 2.2.3
143143
</details>
144144
145145
<details><summary>example.com/packages/goD: 4.4.5</summary>

src/plugins/go-workspace.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ export class GoWorkspace extends WorkspacePlugin<GoModInfo> {
354354

355355
// Parses a go.mod file and returns a list of dependencies
356356
const parseDependencies = (content: string): string[] => {
357-
const depRegex = /(\S+)\s+v(\d+\.\d+\.\d+)/gm;
357+
const depRegex = /(\S+)\s+v(\d+\.\d+\.\d+[^\s]*)/gm;
358358
const deps: string[] = [];
359359
let match;
360360
while ((match = depRegex.exec(content)) !== null) {
@@ -434,7 +434,7 @@ function getChangelogDepsNotes(
434434
// They contain like example.com/foo/bar v1.0.0
435435
// Iterate over the lines and build a list of dependencies
436436
// Do the same for the updated content
437-
const depRegex = /(\S+)\s+v?(\d+\.\d+\.\d+)/gm;
437+
const depRegex = /(\S+)\s+v?(\d+\.\d+\.\d+[^\s]*)/gm;
438438

439439
const parseDependencies = (content: string): Map<string, string> => {
440440
const deps = new Map<string, string>();

test/fixtures/plugins/go-workspace/packages/goC/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ module example.com/packages/goC
33
go 1.23.0
44

55
require (
6-
example.com/packages/goB/v2 v2.2.2
6+
example.com/packages/goB/v2 v2.2.2-0.20250203122516-4c838e530ecb // indirect
77
)

0 commit comments

Comments
 (0)