// Add your own contribution below
-
Internal changes for usage with Peril - orta
-
Add
danger pr --repl
, which drops into a Node.js REPL after evaluating the dangerfile - macklinu -
Add support for Codeship - deecewan
- Add support for Docker Cloud - camacho
- Builds which only use markdown now only show the markdown, and no violations table is shown - mxstbr
- Adds support for running Danger against a PR locally - orta
The workflow is that you find a PR that exhibits the behavior you'd like Danger to run against,
then edit the local Dangerfile.js
and run yarn run danger pr https://github.com/facebook/jest/pull/2629
.
This will post the results to your console, instead of on the PR itself.
- Danger changes to your Dangerfile are not persisted after the run - orta
- Add summary comment for danger message - kwonoj
- Add
jest-environment-node
to the Package.json - orta
-
Adds support for
git.commits
andgit.luolix.topmits
- ortaWhy two? Well git.luolix.topmits contains a bunch of github specific metadata ( e.g. GitHub user creds, commit comment counts. ) Chances are, you're always going to use
git.commits
however if you want more rich data, the GitHub one is available too. Here's an example:
const merges = git.commits.filter(commit => commit.message.include("Merge Master"))
if (merges.length) { fail("Please rebase your PR")}
- Support custom dangerfile via
-d
commandline arg - kwonoj - Allow debug dump output via
DEBUG=danger:*
environment variable - kwonoj - Adds surf-build ci provider - kwonoj
- Forward environment variables to external module constructor - kwonoj
- Support
danger run -ci
to specify external CI provider - kwonoj - Adds
--verbose
todanger
, which for now will echo out all the URLs Danger has requested - orta - Migrate codebase into TypeScript from flow - kwonoj
- Handle removing all sorts of import types for Danger in the Dangerfile - orta
- A failing network request will raise an error - orta
- Fix Dangerfile parsing which broke due to Peril related changes - orta
- Tweak the npmignore, ship less random stuff to others - orta
- Fixes to the shipped Flow/TS definitions - orta
- Adds more functions the the internal Danger GitHub client - orta
- Infrastructure work to allow Peril to run a Dangerfile - orta
- Upgrade outdated ESLint packages - macklinu
- Enhance Windows OS compatibility - kwonoj
- Set exit code to 1 when running
danger
throws an error - macklinu - Add Jenkins CI source - macklinu
- Add .editorconfig - macklinu
- Adds jest-runtime to the dependencies - orta
-
You can build and run in vscode using your own custom
env/development.env
file. This is useful because you can use the debugger against a real PR. Seeenv/development.env.example
for syntax. - orta -
Uses
jest-transform
andjest-runtime
to eval and apply babel transforms.This does two things, makes it feasible to do hosted-danger and makes it possible to write your Dangerfile in a way that's consistent with the rest of your JavaScript. - orta
-
Add tests directory to .npmignore - macklinu
-
Update to Jest 18 - macklinu
- Brings back the ability to emulate a fake CI run locally via
danger
- orta
- Makes
babel-polyfill
a direct dependency, this is because it is actually an implicit dependency in the app. I'm not sure how I feel about this, I guess if we use a part of it in the babel translation of a user's Dangerfile them I'm OK with it. - orta
- Ship flow annotations with the npm module - orta
- Adds more node instances to travis - romanki + orta
- Adds support for Semaphore CI - orta
- The env vars
DANGER_TEST_REPO
andDANGER_TEST_PR
will allow you initialize the FakeCI with a repo of your choice. See README.md for more info - Improved error messaging around not including a
DANGER_GITHUB_API_TOKEN
in the ENV - nsfmc / orta - Adds support for getting the diff for a specific file from git: e.g.
// Politely ask for their name on the entry too
const changelogDiff = danger.git.diffForFile("changelog.md")
const contributorName = danger.github.pr.user.login
if (changelogDiff && changelogDiff.indexOf(contributorName) === -1) {
warn("Please add your GitHub name to the changelog entry, so we can attribute you.")
}
- Does not break commonmark on GitHub - orta
- upgrades to flow 0.35.0 and fixes associated type errors in covariant/invariant interfaces - nsfmc
- omits flow requirement for new test files - nsfmc
- adds support for circleci - nsfmc
- defines CISource properties in flow as read-only - nsfmc
danger.pr
->danger.github.pr
, I've also created interfaces for them - ortawarn
,message
,markdown
are all ported over to DangerJS - orta- Shows a HTML table for Danger message - orta
- Now offers a Flow-typed definition file, it's not shipped to their repo yet, you can make it by
npm run export-flowtype
- orta - Started turning this into a real project by adding tests - orta
- Changes some files casing, added some logs, a bit of error reporting, and verifying everything works through npm - orta
- Danger edit an existing post, and delete it when it's not relevant - orta
- Danger will post a comment on a GitHub PR with any Fails - orta
OK, first usable for others version. Only supports GitHub and Travis CI.
You can run by doing:
danger
Make sure you set a DANGER_GITHUB_API_TOKEN
on your CI - see the Ruby guide for that.
Then you can make a dangerfile.js
(has to be lowercase, deal with it.) It has access to a whopping 2 DSL attributes.
pr
git
fail(message: string)
pr
probably won't be sticking around for the long run, but if you're using a 0.0.2
release, you should be OK with that. It's the full metadata of the PR, so this JSON file.
git
currently has:
git.modified_file
git.created_files
git.deleted_files
which are string arrays of files.
fail(message: string)
will let you raise an error, and will make the process return 1 after the parsing has finished.
Overall: your Dangerfile should look something like:
import { danger } from "danger"
const hasChangelog = danger.git.modified_files.includes("changelog.md")
if (!hasChangelog) {
fail("No Changelog changes!")
}
That should do ya. I think. This doens't support babel, and I haven't explored using other modules etc, so
./
Not usable for others, only stubs of classes etc.