Allow website doc link to be in the PR description #8257
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the docs-link validation script used by the “Check that the PR links to documentation” workflow so that hardhat-website PR links in the PR body are only rejected when they aren’t also referenced via # docs: comments in changeset frontmatters.
Changes:
- Extract hardhat-website PR links from the PR body and from changeset frontmatters, then compare them to detect unmatched body links.
- Add URL normalization to make body/changeset comparisons consistent.
- Improve the failure error message by listing the unmatched links and giving clearer guidance.
Currently, the script throws an error if a website docs PR is linked in the description.
I think this can be annoying for reviewers, as it's easier for them to have a direct link to the docs right there.
So, I modified the script to allow linking the website PR in the description, provided the link is also included in the changeset.
If the link is not in the changeset, the script will still throw an error.
I manually tested the changes in this PR, by adding/removing a link to the website in the description and changes