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

[NT-620] Skip danger for external contributors #964

Merged
merged 2 commits into from
Nov 22, 2019

Conversation

justinswart
Copy link
Contributor

πŸ“² 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

image

βœ… Acceptance criteria

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"
Copy link
Contributor

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.

Copy link
Contributor

@Scollaco Scollaco Nov 22, 2019

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".

Copy link
Contributor

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.

Copy link
Contributor Author

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:

image

Otherwise, yes - it would just say "Skipping Danger For External Contributor" for any failure reason.

Copy link
Contributor

@Scollaco Scollaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@justinswart justinswart merged commit 91df2e4 into master Nov 22, 2019
@justinswart justinswart deleted the skip-danger-external branch November 22, 2019 19:28
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 this pull request may close these issues.

None yet

3 participants