Skip to content

Commit

Permalink
Fix Go major version prerelease testing (#47)
Browse files Browse the repository at this point in the history
Fixes #46

`go get ...` restores existing packages in the go.mod before fetching and switching to the requested version. This fails during major version upgrades as we have updated the example references but not yet published the SDK.

By using `go mod edit` we can set the exact version before attempting to restore dependencies.
  • Loading branch information
danielrbradley authored Sep 19, 2024
1 parent a5b3da9 commit e8b733b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/verifyRelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async function installGoPackageVersion(
.replace('{provider}', opts.provider)
.replace('{moduleVersionSuffix}', moduleVersionSuffix)
const packageVersionRef = `${packageRef}@${opts.packageVersion}`
const addCmd = `go get ${packageVersionRef}`
const addCmd = `go mod edit -require=${packageVersionRef}`
core.debug(`Installing go package: ${addCmd}`)
const addExec = shell.exec(addCmd, { cwd, fatal: true })
if (addExec.code !== 0) {
Expand Down

0 comments on commit e8b733b

Please sign in to comment.