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

Action fails if comment made by user whose account has been deleted prior to merge #527

Closed
enclave-alistair opened this issue Nov 6, 2023 · 2 comments · Fixed by #530
Closed

Comments

@enclave-alistair
Copy link

enclave-alistair commented Nov 6, 2023

A user contributed comments on a PR that uses this action, then subsequently deleted their github account.

It causes this line to fail:

if comment.get('author', {}).get('login') == self._settings.actor

Log output:

File "/action/publish_test_results.py", line 536, in <module>
    main(settings, gha)
  File "/action/publish_test_results.py", line 262, in main
    Publisher(settings, gh, gha).publish(stats, results.case_results, conclusion)
  File "/action/publish/publisher.py", line 223, in publish
    self.publish_comment(self._settings.comment_title, stats, pull, check_run, cases)
  File "/action/publish/publisher.py", line 559, in publish_comment
    latest_comment = self.get_latest_comment(pull_request)
  File "/action/publish/publisher.py", line 664, in get_latest_comment
    comments = self.get_action_comments(comments)
  File "/action/publish/publisher.py", line 7[41](https://github.com/enclave-networks/portal/actions/runs/6745945905/job/18338781721?pr=500#step:9:42), in get_action_comments
    return list([comment for comment in comments
  File "/action/publish/publisher.py", line 7[42](https://github.com/enclave-networks/portal/actions/runs/6745945905/job/18338781721?pr=500#step:9:43), in <listcomp>
    if comment.get('author', {}).get('login') == self._settings.actor
AttributeError: 'NoneType' object has no attribute 'get'
@EnricoMi
Copy link
Owner

EnricoMi commented Nov 8, 2023

Good point, thanks for raising this issue, I will look into fixing this.

@EnricoMi
Copy link
Owner

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

Successfully merging a pull request may close this issue.

2 participants