-
Notifications
You must be signed in to change notification settings - Fork 1
chore: add docs assets download script #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for typst-docs-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
May I push to this branch to fix netlify? |
|
Yes, please go ahead and push to this branch to fix Netlify. |
8f61e84 to
efe9228
Compare
… add en-US v0.14.1
efe9228 to
f0d83cc
Compare
|
Done. Apart from modifications in netlify, I added the |
|
The additions in the commit seem to be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the documentation build process by extracting the docs assets download logic into a reusable shell script (fetch-docs-assets.sh). This consolidation reduces code duplication between the Netlify build script and GitHub Actions CI workflow, making maintenance easier and ensuring consistency across different build environments.
Key Changes:
- Created a new parameterized shell script to handle downloading docs.json, assets, favicon, and generating metadata.json
- Updated both
netlify-build.shand the CI workflow to use the new script instead of duplicating the download logic - Added shell linting tools (shfmt and shellcheck) to the development toolchain and CI pipeline
- Migrated from deprecated metadata fields (
githubRepositoryUrl,discordServerUrl) to the newsocialLinksarray
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/fetch-docs-assets.sh | New reusable script that downloads and prepares documentation assets from GitHub releases with configurable tag, base path, destination, and origin URL |
| scripts/netlify-build.sh | Refactored to use the new fetch script, updated indentation to tabs, added support for v0.14.1, and reordered ja-JP asset preparation |
| .github/workflows/ci.yaml | Simplified build step to use the new fetch script, added new ci-shell job for shell script linting |
| mise.toml | Added shfmt and shellcheck tools for shell script formatting and linting |
| netlify.toml | Updated build command path to reference scripts directory |
Comments suppressed due to low confidence (2)
scripts/netlify-build.sh:82
- The
DEPLOY_URLvariable is used without a fallback value. While the comment indicates it will be set by Netlify, the script should handle the case where it's unset. Consider using:
--origin "${DEPLOY_URL:-https://example.com/}"This ensures the script doesn't fail when DEPLOY_URL is not set, using the same fallback as the default in fetch-docs-assets.sh.
scripts/netlify-build.sh:104
- [nitpick] The base path "/irrelevant/" is used here but the downloaded
metadata.jsonwill still have this value, which could cause confusion. Consider adding a comment explaining that the metadata.json will be overwritten byfetch-docs-ja-jp, or explicitly remove it after downloading the assets:
bash scripts/fetch-docs-assets.sh --tag "v0.13.1" --base "/irrelevant/"
rm public/{docs,metadata}.json # Will be replaced by fetch-docs-ja-jp💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf. #43 (comment)