cheribsd icon indicating copy to clipboard operation
cheribsd copied to clipboard

Making the clang-format check non-fatal

Open bsdjhb opened this issue 2 years ago • 3 comments

bsdjhb avatar Jun 08 '22 22:06 bsdjhb

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.

jrtc27 avatar Jun 28 '22 17:06 jrtc27

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.

jrtc27 avatar Jun 28 '22 17:06 jrtc27

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.

bsdjhb avatar Jun 28 '22 23:06 bsdjhb

Abandoned long ago

jrtc27 avatar Oct 25 '23 21:10 jrtc27