+0
Daily
5,696
stars
495
forks
44
watchers
927
prs
619
issues
131
releases
README
Danger :no_entry_sign:
Formalize your Pull Request etiquette.
-------
What is Danger? •
Vision •
Helping Out •
Plugin Development
-------
What is Danger?
Danger runs during your CI process, and gives teams the chance to automate common code review chores.
This provides another logical step in your process, through this Danger can help lint your rote tasks in daily code review.
You can use Danger to codify your teams norms. Leaving humans to think about harder problems.
For example?
You can:
Enforce CHANGELOGs
Enforce links to Trello/JIRA in PR/MR bodies
Enforce using descriptive labels
Look out for common anti-patterns
Highlight interesting build artifacts
Give specific files extra focus
Danger provides the glue to let _you_ build out the rules specific to your team's culture, offering useful metadata and a comprehensive plugin system to share common issues.
Getting Started
Alright. So, actually, you may be in the wrong place. From here on in, this README is going to be for people who are interested in working on and improving on Danger.
We keep all of the end-user documentation at https://danger.systems.
Some quick links: Guides Index, DSL Reference, Getting Started and What does Danger Do?.
I'm here to help out!
Brilliant. So, let's get you set up.
sh
git clone https://github.com/danger/danger.git
cd danger
bundle install
bundle exec rake spec
This sets everything up and runs all of the tests.
Theory
Danger has a VISION.md file, which sums up the ideas around what Danger is. It is the lower bounds of what Danger means. Orta has written on handling and creating Danger on the Artsy blog, too.
Documentation
The code you write may end up in the public part of the website — the easiest way to tell is that it is vastly overdocumented. If you are working in a space that looks over-documented, please be extra considerate to add documentation. We expect the consumers of that documentation to be non-rubyists, thus you should avoid specific jargon and try to provide duplicate overlapping examples.
Testing
So far, we've not really figured out the right way to make tests for our CLI commands. When we have done so, they've ended up being brittle. So, ideally, try to move any logic that would go into a command into separate classes, and test those. We're okay with the command not having coverage, but ideally the classes that make up what it does will.
I'd strongly recommend using bundle exec guard to run your tests as you work. Any changes you make in the lib, or specs will have corresponding tests run instantly.
Debugging
Ruby is super dynamic. One of the best ways to debug Ruby code is by using pry. We include pry for developers: when you have a problem, copy these two lines just before your problem and follow the instructions from "I Want To Be A Danger Wizard."
ruby
require 'pry'
binding.pry
License, Contributor's Guidelines and Code of Conduct
We try to keep as much disTop issues
#499Incorrect MR ID for GitLab with Drone44 comments · 2016-09-01#1103Danger fails on CI when running on PR from a fork in GH Actions / Buddy Build41 comments · 2019-03-08#727Unable to Setup with Bitbucket Server 32 comments · 2017-02-09#204"Not a Pull Request - skipping `danger` run"30 comments · 2016-05-04#768Danger fails with "Cannot find a merge base between danger_base and danger_head"22 comments · 2017-03-30#382Proposal: Major changes to `danger local`18 comments · 2016-07-28#1106Failed to rescue in block in submit_inline_comments_for_kind!16 comments · 2019-03-13#964fail() does not fail GitLab job16 comments · 2018-03-06
Discussions
#1467Release a new version of Danger2 comments · 2023-11-14#1441How to use Danger on GitLab CI/CD?1 comments · 2023-06-06#1433It seems that Danger doesn't support fine-grained access tokens1 comments · 2023-04-04#1430Danger leaving default comment when no messages to deliver.0 comments · 2023-03-02#1414Centralized DangerJS config file1 comments · 2023-01-10#1412Setting Danger in GHActions - tokens1 comments · 2023-01-09#1408Github Actions not considered a Pull Request1 comments · 2022-12-21#1396Posting PR comment when running locally1 comments · 2022-11-09
Latest release
9.6.2 9.6.2 2026-11-09Support git gem 6.0.0 - @karljamoralin 1560 Allow faraday-http-cache 3.x - @JuanitoFatas 1553 Support deploys from GitHub - @orta [@glensc]: https://github.com/glensc [@telyn]: https://github.com/telyn [1192]: https://github.com/danger/danger/pull/1192 [1191]: https://github.com/danger/danger/issues/1191