[BUG]: Link Checker Github Action is fooled on feature branches because of hardcoded links to /blob/main #693
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
gha
GitHub actions related
good first issue
Good for newcomers
Description
I completed this PR #614 which renamed a file from .env.example to .env.template. All of the actions passed, and I merged it to main, only to get a notification that a github action was failing and I had broken the main branch! Serves me right for doing a merge to main at the end of the day on a Friday 😆 . The issue was that I had forgotten to update some documentation: PR to fix my mistake is here #679.
This should not have been able to happen, the link checker should identify broken links before they happen.
The issue comes from how we reference links to files in our github repo. We often reference files using HTTP links to the main branch, like
https://github.com/mozilla-ai/lumigator/blob/main/README.md?plain=1#L63
[link text](https://github.com/mozilla-ai/lumigator/blob/main/.env.template)
This means that when the link checker runs on a feature branch, it's checking links that point to the main branch, which is why it missed that I had renamed a file and thus broken a link.
Reproduction
Relevant log output
Expected behavior
I think the links in the repo docs should be updated to be relative links, this way they will point to the files that exist on the branch itself, and not always to whatever is in main. This will become more important as we maintain versions of lumigator. (aka we don't want version 1.0 to accidentally be referencing to newer 2.0 docs).
System Info
n/a
Have you searched for similar issues before submitting this one?
The text was updated successfully, but these errors were encountered: