-
Notifications
You must be signed in to change notification settings - Fork 394
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
Fix and update link-check #2954
Conversation
Might solve merge-base issue
37c7a61
to
94597c9
Compare
Tested on #2932, this fixes the link-check problem because |
@@ -21,7 +23,7 @@ jobs: | |||
status: queued | |||
- name: Run Link Check | |||
id: check | |||
uses: iterative/link-check.action@v0.8 | |||
uses: iterative/link-check.action@v0.9 |
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.
Next update I should sync up the action version tag and the NPM version, this can get a little confusing.
@@ -79,7 +79,7 @@ | |||
"react-use": "^14.0.0", | |||
"rehype-react": "^6.2.1", | |||
"remark-preset-lint-recommended": "^5.0.0", | |||
"repo-link-check": "^0.7.1", | |||
"repo-link-check": "^0.8.0", |
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.
This just applies to the local CLI script.
Thanks @rogermparent ! Looks good i.e. I'd approve but
That sounds scary haha. No matter when we merge this there will be several PRs open that may require merging |
I was thinking of that on the CI level, but maybe we can get a decent mid-ground fix by just cherry-picking this commit into the PRs that need it, especially since only one line is actually needed to patch the problem. I can look into that today. |
Just did a retroactive update on the existing PRs that have the problem- without a full master merge, they don't require manual intervention and we get CI results from link-check!
Beyond that, once this is merged we shouldn't run into the same issue in the future. |
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.
Looks good!
This PR fixes the odd failures that are happening on PRs by using
fetch-depth: 0
on the checkout action, allowing full access to all branches' git history and allowing so we can do a proper github-like diff that doesn't includeorigin/master
changes that have happened since the PR in question.Separately, this PR upgrades
link-check
to a new version that uses a small change that uses a single command ofgit diff origin/master...HEAD
instead of a two-stepmerge-base
anddiff
. Functionally the same thing (probably didn't need a minor bump, just a patch, but oh well we're still in0.x.x
), just more simple and elegant- the only reason we didn't do it before is I wasn't aware of triple-dot syntax. I tested this new version a couple times to make sure it doesn't just break everything, and it works fine.One big caveat is that merging master (or any Gatsby 3 commit) into our current Gatsby 2 PRs that currently have this issue will cause caching havoc that needs manual intervention to be remedied. I can do so for PRs that really need it, but I'd suggest using local link-check instead since everyone probably has full commit history locally and it should work. At least we'll have it solved for the future!