Skip to content

Commit f91fa62

Browse files
author
Elliott Shugerman
committed
Fix "single comment" behavior for non-official deployments
If updates are made to a pull request and a comment from the bot already exists, that comment should be updated; a new comment should not be added. However, this functionality is broken for non-official deployments -- ie, deployments using a GitHub user other than "pep8speaks". This commit fixes this by using the BOT_PASSWORD env var to check for an existing comment, rather than hardcoding the user ID.
1 parent 64e65e1 commit f91fa62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pep8speaks/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def create_or_update_comment(ghrequest, comment, ONLY_UPDATE_COMMENT_BUT_NOT_CRE
397397
# Get the last comment id by the bot
398398
last_comment_id = None
399399
for old_comment in comments:
400-
if old_comment["user"]["id"] == 24736507: # ID of @pep8speaks
400+
if old_comment["user"]["login"] == os.environ["BOT_USERNAME"]:
401401
last_comment_id = old_comment["id"]
402402
break
403403

0 commit comments

Comments
 (0)