Repository navigation
ci: fail the release when the tag and the manifest disagree - #58
Merged
Merged
Conversation
The zip name came from the tag and the manifest from extension/package.json, so notes-v0.1.6 shipped a 0.1.4 manifest. Two guards: the tag against package.json before installing, and the built dist/manifest.json against the tag before publishing. Closes #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two guards in
release.yml, because the file name and the manifest came from different sources:extension/package.json. Fails in seconds, with an annotation naming both values.extension/dist/manifest.jsonmust equal the tag. This validates the artefact that actually gets zipped, so it still holds if the manifest source ever changes.Why both: the first catches the mistake before spending a build, the second catches any path where the built manifest disagrees regardless of the input.
Why this exists
notes-v0.1.6shippednotes-0.1.6.zipcontaining a manifest with"version": "0.1.4", becauseextension/package.jsonwas still at 0.1.4 on that commit. The workflow took the zip name from the tag and the version inside from the build. OpenCloud buildsexternal_appsfrom the manifests at service start, so the apps menu showed 0.1.4. Reported by a user in #49.Verification
Both guards were executed locally against the real repository state, not just written:
notes-v0.1.7withpackage.json0.1.7 -> passes (exit 0)notes-v0.1.6withpackage.json0.1.7 -> fails (exit 1), which is the exact case that published the broken assetnpm run build,dist/manifest.jsonsays 0.1.7: tag 0.1.7 passes, tag 0.1.99 failsThe workflow itself only runs on tag pushes, so its first real execution will be the next release. The YAML was parsed with a strict loader to confirm the step list is what it should be.
Closes #56