-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[NT-620] Skip danger for external contributors #964
Conversation
bin/danger.sh
Outdated
@@ -0,0 +1,3 @@ | |||
#!/bin/sh | |||
|
|||
[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger --verbose || echo "Skipping Danger for External Contributor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this print "Skipping Danger For External Contributor" if bundle exec danger --verbose
fails for any reason? π€ My bash scripting skills are very weak I admit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't say much about it on their website, but I believe that it means "If you don't have the token and
try to execute this command, print that".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm more wondering about the case where the token is present, but bundle exec danger
returns a false
value for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @ifbarrera, I've updated the script to fail under normal circumstances with:
Otherwise, yes - it would just say "Skipping Danger For External Contributor" for any failure reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
π² What
Does not run Danger on PRs from external contributors.
π€ Why
We received an external contribution recently and the CircleCI workflow that runs Danger is failing because it does not have access to
DANGER_GITHUB_API_TOKEN
.π How
π See
β Acceptance criteria