-
Notifications
You must be signed in to change notification settings - Fork 14
CI: pass with comment on linkcheck fail #462
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
base: master
Are you sure you want to change the base?
CI: pass with comment on linkcheck fail #462
Conversation
b6df625
to
04a31f8
Compare
I've tested that this works on my own forked repo, but of course until the second workflow file is merged here I can only hope that it actually solves the permissions as intended. |
04a31f8
to
9f4a831
Compare
Another simpler approach would be to drop the linkcheck requirement from I'm fine either way, though. Perhaps others can chime in on their preferences. In any event, dropping the explicit required checks in |
I completely agree that it's overkill, haha! But it was the only way I could find to have the workflow show as 'passing' even if the linkcheck failed while still actually providing a warning that it had failed, and by that point I was in too deep and figured I'd just try implementing it to learn more about GitHub's CI 😁 Feel free to just make a simpler PR and close this though, if you prefer! Other options I saw were just to use |
This change has been enabled with the merge of #464, but it is good practice to move the status checks to branch protections anyway since it is easier to keep up to date. Your point about the status checks almost always being red is salient. I think we should accept this PR and see how it goes. Thanks! |
I'm going to rebase then merge this @sam-maloney. Hope that's ok. |
9f4a831
to
bade8c3
Compare
Oh, new validator typos support caught one typo in a commit message. |
Problem: linkcheck fails frequently for various out-of-our-control reasons Make the workflow pass regardless of `make linkcheck` outcome, but post a comment to the PR notifying if linkcheck failed.
Problem: workflows triggered by a pull_request from an xternal fork do not have permission to write comments. Use a 2nd workflow triggered by the completion of the first via workflow_run to write the comment if necessary. Based on: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
bade8c3
to
15b40d4
Compare
Always OK with me to rebase/edit/mangle my PRs in any way you see fit, haha! 😁 |
Problem: linkcheck fails frequently for various out-of-our-control reasons
Make the workflow pass regardless of
make linkcheck
outcome, but post a comment to the PR notifying if linkcheck failed.Such a workaround is necessary because unfortunately GitHub CI does not natively support a sensible
allow-failure
type option, see e.g. actions/runner#2347 or https://github.com/orgs/community/discussions/15452[Update]
It also turns out that workflows on PRs triggered from external forks do not have permission to create comments, so the attempt in the first commit is insufficient.. Instead a 2nd workflow is required, which is triggered by the completion of the main workflow, but since it is triggered by the target repo itself, this 2nd workflow should have permission to comment 🤞
This is based on: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/