-
Notifications
You must be signed in to change notification settings - Fork 3
build_antora.sh: patch base-url with permalink #45
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
base: develop
Are you sure you want to change the base?
Conversation
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 adds CI environment detection and dynamic base URL configuration to the Antora documentation build process, and removes a branch restriction from the GitHub Pages deployment workflow.
- Detects CircleCI and GitHub CI environments to set repository-specific base URLs
- Modifies and restores
mrdocs.ymlconfiguration file during the build process - Allows GitHub Pages deployment for any branch (previously restricted to
feature/doc)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| doc/build_antora.sh | Adds CI environment detection logic to dynamically set base URLs and implements config file backup/restore mechanism |
| .github/workflows/ci.yml | Removes branch name restriction from GitHub Pages deployment condition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| base_url="https://github.com/${repository}/blob/${sha}/" | ||
|
|
||
| if [ -n "${base_url}" ]; then | ||
| echo "Setting base-url to $base_url" | ||
| cp mrdocs.yml mrdocs.yml.bak | ||
| perl -i -pe 's{^\s*base-url:.*$}{base-url: '"$base_url"'}' mrdocs.yml | ||
| fi | ||
|
|
Copilot
AI
Nov 3, 2025
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.
The base_url variable is set unconditionally even when repository and sha are undefined (i.e., when neither CIRCLE_REPOSITORY_URL nor GITHUB_REPOSITORY is set). This results in an invalid URL https://github.com//blob//. The assignment should be moved inside the conditional block or wrapped in a check for non-empty repository and sha.
| base_url="https://github.com/${repository}/blob/${sha}/" | |
| if [ -n "${base_url}" ]; then | |
| echo "Setting base-url to $base_url" | |
| cp mrdocs.yml mrdocs.yml.bak | |
| perl -i -pe 's{^\s*base-url:.*$}{base-url: '"$base_url"'}' mrdocs.yml | |
| fi | |
| if [ -n "${repository}" ] && [ -n "${sha}" ]; then | |
| base_url="https://github.com/${repository}/blob/${sha}/" | |
| echo "Setting base-url to $base_url" | |
| cp mrdocs.yml mrdocs.yml.bak | |
| perl -i -pe 's{^\s*base-url:.*$}{base-url: '"$base_url"'}' mrdocs.yml | |
| fi |
Hey! 😊 I was thinking maybe:
But of course, you’d need to check if that really makes sense 👍❤️ |
|
These changes are great, by the way 😊 I can totally see a lot of people replicating this logic |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #45 +/- ##
===========================================
- Coverage 93.03% 92.03% -1.00%
===========================================
Files 40 40
Lines 2713 2838 +125
Branches 1226 1354 +128
===========================================
+ Hits 2524 2612 +88
- Misses 159 187 +28
- Partials 30 39 +9 see 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Not sure what a fallback value should be, although there is one: if the script doesn't recognize the context, it leaves
base-urlalone, that is, currently, it links to thereleasebranch.@pdimov for awareness