chore(ci): prevent publishing invalid SRIs #2042
Merged
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.
An SRI is essentially a hash of axe.js. As of version 3.1 (I think) , we are bundling a few external dependencies into axe-core. This hash is created when we create the release branch, and put into sri-history.json. If any of the dependencies is different when we build locally for the release branch, from when we build in CI right before executing
npm publish
, axe-core will not be identical, and the SRI in sri-history.json will be incorrect.To fix this, this PR does:
npm ci
to ensure the server build has the dependencies in the lock filenpm ci
part of thenpm run release
script, to ensure dependencies are in sync with package-locknpm run sri-validate
before releasing to test the sri matches what is in sri-history.jsonReviewer checks
Required fields, to be filled out by PR reviewer(s)