cheribsd
cheribsd copied to clipboard
Making the clang-format check non-fatal
This fails because forks don't have permission to add comments. #1432 shows it working (ish) from a branch in this repo, with the fixups squashed and the bogus permissions diff dropped (presumably there to try to make forks work, but you can't do it like that, otherwise forks could just change the permission in their copy of the .yml file and elevate their permissions in the original repo, and you wouldn't want to hand out automated create+update permission to forks anyway). But it's still marked as failing, just also adds a comment.
There are ways to make it work from forks too, but it's a bit clunky. You have to have the clang-format check perform its actions and upload the result as an artifact, then have a workflow defined in main's .github folder trigger on that. This is how I made the test results comment work for sail-riscv.
Actually, the other approach is to make it fire on pull_request_target or whatever the event is called. It's just harder to test if you do that as GH won't run an pull_request_target action on a PR that changes the action. I could test it by creating a PR against this that has the style diff, but making it a pull_request_target event requires further changes to find the thing you want to checkout, etc.
Abandoned long ago