ci[pr-check-links]: dump links from baseline commit for pr link checking #180
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.
Description
More recent updates in main
In the
check_links_in_diffs
workflow, the feature branch links are compared to the main branch links. As finalizing changes in a feature branch might take a while, its links get outdated compared to main. This can lead to false positives.In the proposed updates, the feature branch links are compared to the main branch commit at which the feature branch was created. In this way, the more recent changes in main do not affect link checking.
Anchors / fragments affected by updates
All links are dumped into
.lycheeignore
from the main branch commit at which the feature branch was created. File names or headings to which the anchor / fragment point might get updated. Yet, checking of fragment links is bypassed. This PR adds steps to identify the files with updated file names and heading titles and removes all links in these files from.lycheeignore
.The downside is that if somebody alters a filename of a heading title, all anchor links in this file will be checked anew. On the other hand, if somebody touches an existing file, that would most likely be a maintainer or the author who be in the position to make sure that all links in these files are valid.
Cleaning up artifacts and any changes to files done in CI
Also, there were a couple of occasions when the check still failed after corrections were pushed. Creating a new PR with these changes had all checks passed successfully. A culprit might have been a cached file with old links that were not overridden (no other ideas for now). A step has been added to clean up all changes done in CI after the check completes.
Related
This updates the changes introduced in PR #107. The changes are tracked is issue #101.
Testing
Tests run:
pr-check-links
pr-check-links
pr-check-links
.lycheeignore
.lycheeignore
Checklist
Before submitting a Pull Request, please ensure the following: