My preview environment on GitHub is failing when trying to post a comment

I forked one of our examples, and when Okteto is deploying the preview environment, it is failing with this error:

/usr/local/bundle/gems/octokit-6.1.1/lib/octokit/response/raise_error.rb:14:in `on_complete': POST https://api.github.com/repos/rberrelleza/external-resources-tf-aws/issues/1/comments: 403 - Resource not accessible by integration // See: https://docs.github.com/rest/reference/issues#create-an-issue-comment (Octokit::Forbidden)
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/middleware.rb:18:in `block in call'
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/response.rb:42:in `on_complete'
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/middleware.rb:17:in `call'
	from /usr/local/bundle/gems/octokit-6.1.1/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
	from /usr/local/bundle/gems/octokit-6.1.1/lib/octokit/middleware/follow_redirects.rb:61:in `call'
	from /usr/local/bundle/gems/faraday-retry-2.2.0/lib/faraday/retry/middleware.rb:153:in `call'
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/rack_builder.rb:153:in `build_response'
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/connection.rb:444:in `run_request'
	from /usr/local/bundle/gems/faraday-2.7.5/lib/faraday/connection.rb:280:in `post'
	from /usr/local/bundle/gems/sawyer-0.9.2/lib/sawyer/agent.rb:99:in `call'
	from /usr/local/bundle/gems/octokit-6.1.1/lib/octokit/connection.rb:156:in `request'
	from /usr/local/bundle/gems/octokit-6.1.1/lib/octokit/connection.rb:28:in `post'
	from /usr/local/bundle/gems/octokit-6.1.1/lib/octokit/client/issues.rb:284:in `add_comment'
	from /notify-pr.sh:36:in `<main>'

This only happens when the repo is on my personal account, but not when it is under an organization.

Hi @ramiro ,

Okteto’s GitHub action uses the secret OKTETO_GITHUB which is generated by GitHub on each workflow (here you can find more information about it).

It might happen that the GitHub token generated in the action doesn’t have write permissions to post the comment. In this GitHub help page you can find how to check and change the permissions.

Summarizing, you can go to Settings in your GitHub repository, select Actions -> General and you should see a section called Workflow permissions which looks like this

You should set the option Read and write permissions to let the action to post a comment.

Hope this helps!