Fix markdown relative links to use HTTP URLs in templates#40
Merged
DutchmanNL merged 3 commits intomainfrom Sep 19, 2025
Merged
Fix markdown relative links to use HTTP URLs in templates#40DutchmanNL merged 3 commits intomainfrom
DutchmanNL merged 3 commits intomainfrom
Conversation
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] md links to http
Fix markdown relative links to use HTTP URLs in templates
Sep 19, 2025
Copilot stopped work on behalf of
DutchmanNL due to an error
September 19, 2025 02:59
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces relative markdown links to snippet files in templates with absolute HTTPS URLs to raw GitHub content, ensuring links remain valid when the templates are copied into external repositories. It also adds a test suite to validate the presence of correct HTTP links and absence of relative references.
- Convert relative snippet links to absolute raw GitHub URLs
- Add tests to verify link correctness and optionally check URL accessibility
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| templates/initial-setup-automation.md | Updated snippet links to absolute HTTPS raw GitHub URLs |
| templates/automated-template-update.md | Updated version check snippet link to absolute HTTPS raw GitHub URL |
| tests/test-http-links.sh | New test verifying templates do not contain relative snippet links and do contain the expected HTTP URLs |
Comment on lines
+27
to
+59
| run_test_with_output() { | ||
| local TEST_NAME="$1" | ||
| local EXPECTED_PATTERN="$2" | ||
| local COMMAND="$3" | ||
|
|
||
| echo -n " Testing $TEST_NAME... " | ||
|
|
||
| if eval "$COMMAND" 2>/dev/null | grep -q "$EXPECTED_PATTERN"; then | ||
| echo -e "${GREEN}✅ PASS${NC}" | ||
| return 0 | ||
| else | ||
| echo -e "${RED}❌ FAIL${NC}" | ||
| EXIT_CODE=1 | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # Test framework helper for negative tests (commands that should fail) | ||
| run_negative_test() { | ||
| local TEST_NAME="$1" | ||
| local COMMAND="$2" | ||
|
|
||
| echo -n " Testing $TEST_NAME... " | ||
|
|
||
| if eval "$COMMAND" 2>/dev/null; then | ||
| echo -e "${RED}❌ FAIL${NC}" | ||
| EXIT_CODE=1 | ||
| return 1 | ||
| else | ||
| echo -e "${GREEN}✅ PASS${NC}" | ||
| return 0 | ||
| fi | ||
| } |
There was a problem hiding this comment.
Using eval and a second grep in a pipeline is unnecessary and brittle. Simplify by invoking grep directly and checking its exit status, which also removes quoting pitfalls and command injection risk. Example:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI
added a commit
that referenced
this pull request
Sep 19, 2025
Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
DutchmanNL
added a commit
that referenced
this pull request
Sep 19, 2025
…47) * Initial plan * Fix README and documentation links to use HTTP URLs in line with #40 Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com>
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.
The template files contained relative markdown links to snippet files (
../snippets/version-check-command.mdand../snippets/github-action-version-check.yml) that would break when these templates are used in external repositories outside of this one, since thesnippets/directory doesn't exist there.This change converts all relative snippet references to absolute HTTP URLs pointing to the raw GitHub content:
Before:
After:
The fix ensures that when developers copy these templates to their own repositories (as intended), all links will continue to work correctly by pointing directly to the authoritative source content.
Additionally, added comprehensive tests (
tests/test-http-links.sh) to validate the HTTP URL conversion and prevent regression of this issue in the future.Files modified:
templates/initial-setup-automation.md- Fixed both version check and GitHub Action snippet referencestemplates/automated-template-update.md- Fixed version check command referencetests/test-http-links.sh- New test to validate HTTP URLs and prevent regressionAll URLs have been verified to return the expected content and all existing tests continue to pass.
Fixes #39.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.