-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
[BUG] Duplicate report coments on GitHub actions if we use a custom CI bot token #1347
Comments
I agree that your logic is pretty sound, but the thing that doesn't fit for me is that almost everywhere I use danger it's GitHub Actions + a custom token - for example here: DefinitelyTyped/DefinitelyTyped#63851 (comment) I think it's likely you're not using |
@orta So earlier I was using In the example you showed in DefinitelyTyped/DefinitelyTyped#63851 (comment), it seems to be using danger v10.1.1 whereas the above logic was introduced later. I updated the danger-js package on CI and was able to reproduce: |
We have the same problem. We updated today from 11.1.4 to 11.2.1 and since then the bot writes new comments instead of editing old ones. We have always used |
#1337 feels like the culprit to me |
@orta Should we revert the PR then? |
@orta I am experiencing the same issue, is there any plan to revert the problematic commit? |
I figured someone would have a think and see if my guess was correct - but I'm fine with just reverting it |
Alright, that's shipped |
@orta Thanks. I just updated to v11.2.2 and it has fixed the issue. |
Describe the bug
Github-actions[bot] user id is hardcoded in the codebase:
danger-js/source/platforms/github/GitHubAPI.ts
Lines 133 to 139 in 47dfcfa
So if we do not use Github-actions[bot] on CI we get duplicate comments as the following condition is always false:
danger-js/source/platforms/github/GitHubAPI.ts
Line 93 in 47dfcfa
As a result, we get duplicate comments on the PR.
We have a separate bot account on GitHub which we use to perform all the automation via GitHub actions, hence not using the default
secrets.GITHUB_TOKEN
on CI.To Reproduce
Run dangerJS on GitHub actions with a token other than
secrets.GITHUB_TOKEN
Expected behavior
It should edit the previous comment.
Screenshots
Your Environment
Additional context
Allow a new env variable
USE_CUSTOM_CI_TOKEN
or something similar.The text was updated successfully, but these errors were encountered: