-
Notifications
You must be signed in to change notification settings - Fork 429
Abort CodeQL action if the status cannot be reported #308
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
Conversation
1baea41 to
0c3bc82
Compare
Put more fine grained logic around which errors we ignore and process. Re-instate status reporting in Enterprise. Abort the code scanning process the status endpoint reports it is not configured.
2ca8035 to
68dedea
Compare
|
@robertbrignull I had a chat with Marco and he is keen to keep using the status endpoint to determine if code scanning is enabled. To do so, I have had to undo your previous change and start treating 404 and 403 as stop conditions. I have attempted to keep to the spirit of the original code by treating other errors in a similar way:
Unstitching something makes me nervous. I would be very grateful if you could give this a once over and see if it makes sense! ❤️ |
robertbrignull
left a comment
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.
Generally looks good and looks like it should work, though I had a few comments.
e151951 to
0a6fcd8
Compare
0a6fcd8 to
f3ff4c8
Compare
Until there is a more robust versioning system it is probably safest to require endpoint compatiblity and not continue the action if there is a mismatch.
fa1125c to
17d4671
Compare
robertbrignull
left a comment
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.
Thanks. The changes LGTM now, and I've tried it out on a GHES instance and it works as expected.
Save action minutes by only running the CodeQL check if code scanning is enabled for the repository.
This reverts some work done in #128
This is nearly a no-op against Enterprise but there is value in not maintaining two separate behaviours.
Enterprise will log a warning and not fail on a 422. This may occur if the bundled version of CodeQL was updated on an old version of Enterprise.Merge / deployment checklist
@robertbrignullif this behaviour is new, or if there is an edge case that I have not managed to reproduce in my local setup.I think this is likely a change in octokit. As both the response and the HTTP error have a status field it seems reasonable to check it on both success and failure using the same code. If it changes in future this code should continue to work the same.