[DOCS]: Pin MathJax npm install with commit hash. - #889
Conversation
There was a problem hiding this comment.
Pull request overview
Pins the MathJax asset pre-download in the docs Antora Docker image to a specific Git commit, aiming to improve supply-chain security and OpenSSF scoring as described in #847.
Changes:
- Replace
npm pack mathjax@3withnpm pack git+https://github.com/mathjax/MathJax.git#<commit>to pin the download to a specific commit. - Document the pinned MathJax commit in the Dockerfile comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # MathJax 0bfa580685ca72e4a3a37657ccd754a65c1a42c6: v4.1.3 | ||
| RUN mkdir -p /opt/mathjax \ | ||
| && npm pack mathjax@3 --pack-destination /tmp \ | ||
| && npm pack git+https://github.com/mathjax/MathJax.git#0bfa580685ca72e4a3a37657ccd754a65c1a42c6 --pack-destination /tmp \ |
| RUN mkdir -p /opt/mathjax \ | ||
| && npm pack mathjax@3 --pack-destination /tmp \ | ||
| && npm pack git+https://github.com/mathjax/MathJax.git#600692ad9d3552cc25f85510d5797bc942ecc9f7 --pack-destination /tmp \ | ||
| && tar -xzf /tmp/mathjax-*.tgz -C /tmp \ |
There was a problem hiding this comment.
@michalharakal Should we addresse this?
|
I switched from the long commit hash to the short form because the long commit form caused the error |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
docs/.docker/Dockerfile:89
npm packis pinned only by a 7‑char short SHA (#600692a), which can become ambiguous over time, and the subsequenttar -xzf /tmp/mathjax-*.tgzstill relies on a wildcard that can match multiple files and break the build. Use the full commit hash in the git URL and capture the exact tarball filename emitted bynpm packso extraction is deterministic and robust.
&& npm pack git+https://github.com/mathjax/MathJax.git#600692a --pack-destination /tmp \
&& tar -xzf /tmp/mathjax-*.tgz -C /tmp \
This
PRpins thenpmpackage installations ofMathJaxin theDockerfileused in thedocsdirectory with their commit hash to increase security (#847).The OpenSSF Score should increase after this
PRhas been merged.