Questions tagged [danger]

Also known as Danger.js. Danger runs during your CI process, and gives teams the chance to automate common code review chores.

https://danger.systems/js/

Danger runs during your CI process, and gives teams the chance to automate common code review chores.

This provides another logical step in your build, 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.

This happens by Danger leaving messages inside your PRs based on rules that you create with JavaScript or TypeScript.

Over time, as rules are adhered to, the message is amended to reflect the current state of the code review.

17 questions
1
vote
1 answer

How to access Bitrise iOS test results from Swift DangerFile?

I'm trying to implement danger-swift but I don't know where I can access test results and flag failing ones from Bitrise. I'm using a plugin for danger-swift called DangerXCodeSummary but I don't know where Bitrise stores test results from…
Luke97
  • 529
  • 3
  • 11
  • 27
1
vote
1 answer

Is there a way to pass a github actions workflow job on addition of a PR label?

I am using danger to check for specific label being added, and on that check being true I then want to pass a workflow job which was previously failing e.g. const gitHubLabels = danger.github.issue.labels.map((label) => label.name.trim()); const…
jingteng
  • 2,331
  • 4
  • 13
  • 16
1
vote
3 answers

Get Current Git branch name in Danger Js script

I am writing a custom danger js check in danger js. I want to avoid running this check when the branch is a hotfix/* branch I want to know how to get the current branch name in the javascript scope in which the dangerfile.js file runs. I've read the…
Probosckie
  • 1,585
  • 4
  • 25
  • 40
1
vote
1 answer

Is there anyway to split dangerfile to smaller parts?

I'm trying to split dangerfile into small parts because we added many checks/automation so it's super helpful but it gets harder to manage it. but when I try to make it, it always gives me this error; Unable to evaluate the Dangerfile Hey there,…
the_bluescreen
  • 3,126
  • 2
  • 18
  • 31
1
vote
3 answers

Exclude files from Danger.js addittions and deletions

We are trying to set a max line change in our prs but are noticing there are some meta files that will easily exceed this limit such as yarn.lock. does anyone know how to exclude files from the additions and deletions? // ... const linesAdded =…
Seth McClaine
  • 9,142
  • 6
  • 38
  • 64
0
votes
1 answer

Why don't Danger failures halt my CI build?

I'm running Danger as part of my lint/pre-compile on github actions. Here's a simplified version of the shell script call: set -e danger --dangerfile="dangerfile-pre-compile.rb" Danger failures are triggering and showing up in the PR checks, but…
Clay Bridges
  • 11,602
  • 10
  • 68
  • 118
0
votes
0 answers

danger-plugin-istanbul-coverage": "^1.6.2 giving flaky results

I am using danger-plugin-istanbul-coverage": "^1.6.2 but its coverage results sometimes confuse me. Sometimes the results look right but sometimes, totally wrong. For example, it tells for a given file that coverage is 0 (when its 0) but in the…
user1892775
  • 2,001
  • 6
  • 37
  • 58
0
votes
1 answer

How to use Danger on GitLab CI/CD?

GitLab CI/CD is already set up to run Danger, you have to add this to your .gitlab-ci.yml file: include: - project: 'gitlab-org/quality/pipeline-common' file: '/ci/danger-review.yml' Reference: /ci/danger-review.yml I'm also overriding the…
Edward J. Stembler
  • 1,932
  • 4
  • 30
  • 53
0
votes
1 answer

How to split Dangerfile to multiple smaller files

I am trying to split Dangerfile into multiple files and call them from the main Dangerfile. I tried this way, In the parent Dangerfile puts "Branch #{github.branch_for_base} #{git.lines_of_code}" require_relative "scripts/large_diff.rb" warn 'Some…
Johnykutty
  • 12,091
  • 13
  • 59
  • 100
0
votes
0 answers

Github urls for file change diffs

I am trying to get hyperlinks to the file diff version of a file shown in the Files tab in github in a PR: When I click on the file name the url changes…
Probosckie
  • 1,585
  • 4
  • 25
  • 40
0
votes
1 answer

How to detect png, jpg images using Ruby?

Just trying to detect png and jpg images in the github pull request using DangerFile. Here is everything that I found modified_files_has_wrong_pic_formant = git.modified_files.any? { |file| /.*\.(png|jpg)/.match(File.extname(file))…
0
votes
1 answer

Download a GitHub file with Octokit::Client in Ruby

I am trying to download an XML file from GitHub via Octokit::Client in Ruby. This is in a Dangerfile, so I have access to the client via github.api. I have got something working with the following code: listing =…
Erik Allen
  • 1,841
  • 2
  • 20
  • 36
0
votes
1 answer

How to update danger

I'm facing a really weird issue and would appreciate any help. When I run danger --version I get 4.3.5 But when I run gem list -a danger I get danger (8.2.3, 8.2.2) And when I use yes | gem uninstall -a --force danger it uninstall danger 8.2.2…
Shivam Pokhriyal
  • 1,044
  • 11
  • 26
0
votes
1 answer

Include code from another module in DangerJS?

Is it possible to include code from another module into your dangerfile.js or dangerfile.ts? Specifically I mean your code, not some dependency defined in your package.json. I've tried it with a few different styles of include/require in both JS and…
maxjeffos
  • 63
  • 3
0
votes
1 answer

Running Danger on Jenkins is skipped with the error: Not a Jenkins Pull Request

I want to run Danger test on the CI that runs on Jenkins. I'm using scripted pipelines. I have installed the GitHub branch source plug-in into Jenkins. I have also created a personal access token to the builds_user account (that Jenkins uses for…
kingston
  • 11,053
  • 14
  • 62
  • 116
1
2