Skip to content
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

COMMENT_FILE_WRITTEN always false #291

Closed
jirikralik opened this issue Oct 23, 2023 · 4 comments
Closed

COMMENT_FILE_WRITTEN always false #291

jirikralik opened this issue Oct 23, 2023 · 4 comments

Comments

@jirikralik
Copy link

jirikralik commented Oct 23, 2023

Hello guys,
could you please explain me this flag? When it is true? I followed your approach and we are able to generate comments with % coverage for our PRs, however I am not able to update the "python-coverage-comment-action-data" branch. The branch was generated, but now for my PRs, the flag is always false, and it wont store the comment. Thank you for your help!
Screenshot from 2023-10-23 15-18-28

@kieferro
Copy link
Member

The COMMENT_FILE_WRITTEN flag indicates whether the action was able to post the comment when it was first called.
If you look at the workflow example here, you can see that the action is called once and if it wasn't able to post the comment (because the PR is external and therefore doesn't have the necessary permissions) it uploads the comment and posts it from a separate workflow with more permissions.
But if you only use PRs from contributors with permission, that flag is always false. (In that case you could also just use the workflow structure described here and completely ignore the flag).

however I am not able to update the "python-coverage-comment-action-data" branch

This is only supposed to happen after a push event on the default branch. If I understand you correctly, you are talking about a PR event. What would be the behaviour you would expect?

@ewjoachim
Copy link
Member

(... Maybe we need to be clearer in the Readme. It's always a struggle between adding more content to cover more cases, and removing content because nobody reads when it's too long).

@jirikralik
Copy link
Author

thank you guys. I adjusted the script and now it is working!

@jirikralik
Copy link
Author

Job done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants