Skip to content

[BUG] all changes regardless of type are grouped incorrectly into modified_files in danger.git #1446

Closed
@xphir

Description

Describe the bug

Since version 12.0.1, all changes (including deletions, creations, and modifications) are incorrectly grouped under modified_files. The created_files and deleted_files arrays remain empty, even when there are clearly file creations or deletions.

To Reproduce
Steps to reproduce the behavior:

  1. On version 11.3.1, create a dangerfile.ts as follows:
import { danger} from "danger"

console.log("Created", danger.git.created_files)
console.log("Deleted", danger.git.deleted_files)
console.log("Modified", danger.git.modified_files)
  1. Run the command npx danger pr https://github.com/danger/danger-js/pull/9.
  2. Observe the expected output:
Starting Danger PR on danger/danger-js#9
Created [ 'yarn.lock' ]
Deleted [ 'npm-shrinkwrap.json' ]
Modified [ 'README.md', 'package.json' ]

Danger: ✓ passed review, received no feedback.
  1. Update the version to 12.0.1
  2. Run the same command: npx danger pr https://github.com/danger/danger-js/pull/9
  3. Notice the unexpected and incorrect output:
Starting Danger PR on danger/danger-js#9
Created []
Deleted []
Modified [ 'README.md', 'npm-shrinkwrap.json', 'package.json', 'yarn.lock' ]

Danger: ✓ passed review, received no feedback.

Expected behavior
I would expect the behavior to remain consistent with version 11.3.1, where deletions are grouped in deleted_files, creations in created_files, etc.

Your Environment

software version
danger.js 12.0.1, 12.1.0 & 12.2.0
node v20.12.1 & v18.20.2
npm 10.5.0
Operating System MacOS Sonoma 14.4.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions