How to fix POST /repos/…/check-runs 403 error on GitHub Action workflow
Today, I created a new GitHub repo and started a new .NET 6 project with some unit tests. As mentioned in an earlier article I wrote, when the unit test runs, the test result is generated, and we can publish it as part of the GitHub Action Workflow as seen in the example below.
Unfortunately, that did not happen as expected this time, and I encounter a strange 403 error.
What the hack is a POST /repos/…/check-runs error!
I tried my favorite search engines without much success. Finally, I had to go looking around, thinking it could be related to some permission issue because a file is being written?
I started with Actions permissions.
Nothing interesting yet, so I scrolled down and found something! Workflow permission and it defaulted to Read repository contents permission. Seemed like I need to have Read and write permissions instead.
I changed the setting, and my GitHub Action Workflow ran fine this time as seen in the first screenshot.
It seemed this must be something new because I have created GitHub projects in the past and had not encountered this issue until now. I hope this helps someone with a similar issue.