Fix plugin.json version field to match release tag#17
Conversation
… hook Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the packaged plugin manifest so plugin.json’s version matches the Git tag/release version, enabling accurate programmatic version verification.
Changes:
- Add a GoReleaser
before.hookscommand to rewriteplugin.json’sversionfield to{{ .Version }}prior to archiving. - Update
plugin.jsonto use a source-level placeholder version (0.0.0-dev) intended to be replaced during release builds.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.goreleaser.yml |
Adds a pre-build hook to patch the manifest version at release time. |
plugin.json |
Replaces the hardcoded version with a dev placeholder to be overridden by GoReleaser. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| before: | ||
| hooks: | ||
| - "sed -i.bak 's/\"version\": \".*\"/\"version\": \"{{ .Version }}\"/' plugin.json && rm -f plugin.json.bak" |
There was a problem hiding this comment.
The before.hooks command rewrites plugin.json in-place and does not restore it afterward. Running GoReleaser locally (or in CI retries) will leave the working tree dirty and, if the release fails mid-run, the repo may be left with a modified plugin.json. Consider writing the versioned manifest to a separate file (e.g., under dist/) and archiving that, or add a follow-up step to restore plugin.json from the backup once artifacts are produced (if supported by your GoReleaser version).
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Done in 5619833. Added
|
plugin.jsonhas always shipped with"version": "1.0.0"regardless of the actual release tag, making programmatic version verification impossible.Changes
.goreleaser.yml: Add abefore.hooksentry that rewrites theversionfield inplugin.jsonusing the goreleaser{{ .Version }}template before archiving:Uses
sed -i.bak(works on both GNU sed/Linux and BSD sed/macOS).plugin.json: Replace the stale"version": "1.0.0"with"version": "0.0.0-dev"to clearly signal this is a source-level placeholder replaced at release time.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.