Skip to content

fix(ci): add --fail-on-errors to danger ci command#132

Merged
mcj-coder merged 1 commit intomainfrom
fix/131-danger-fail-on-errors
Jan 16, 2026
Merged

fix(ci): add --fail-on-errors to danger ci command#132
mcj-coder merged 1 commit intomainfrom
fix/131-danger-fail-on-errors

Conversation

@mcj-coder
Copy link
Copy Markdown
Contributor

@mcj-coder mcj-coder commented Jan 16, 2026

Summary

  • Add --fail-on-errors flag to danger ci command in workflow
  • Without this flag, workflow passes even when Danger finds rule violations

Problem

Two separate checks were created:

  1. Check Run ("Danger PR Validation") - Always passed if workflow completed
  2. Status Context ("Danger") - Showed actual failures

This allowed PR #130 to merge despite Danger showing failures.

Fix

- run: npx danger ci
+ run: npx danger ci --fail-on-errors

Now the workflow will fail when Danger finds issues, blocking the merge.

Closes: #131

Test Plan

  • Verify workflow syntax is valid
  • Test on a PR with Danger violations to confirm it blocks merge

🤖 Generated with Claude Code

Without this flag, `danger ci` exits 0 even when it finds rule violations.
This caused the "Danger PR Validation" check run to pass while the "Danger"
status context showed failures, allowing PRs to merge despite failing rules.

Adding --fail-on-errors ensures the workflow fails when Danger finds issues,
making the check run status match the actual validation results.

Fixes #131

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mcj-coder mcj-coder enabled auto-merge (squash) January 16, 2026 16:34
Copy link
Copy Markdown
Collaborator

@martincjarvis martincjarvis left a comment

Choose a reason for hiding this comment

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

LGTM - simple one-line fix that makes the Danger check actually block merges when it finds failures.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 16, 2026

Messages
📖 Remember: This PR will be squash-merged. Ensure the PR title follows conventional commits format.

Generated by 🚫 dangerJS against b899c63

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mcj-coder mcj-coder merged commit 291199c into main Jan 16, 2026
17 checks passed
@mcj-coder mcj-coder deleted the fix/131-danger-fail-on-errors branch January 16, 2026 16:40
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.

Danger check passes even when rules fail

2 participants