greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
183 stars 73 forks source link

Travis CI errors "Please commit your changes or stash them before you merge." #117

Open Jomik opened 6 years ago

Jomik commented 6 years ago

https://github.com/Jomik/cerberus/pull/4

https://travis-ci.org/Jomik/cerberus/builds/343590621

ComFreek commented 6 years ago

I have just had the same error on a PR from Greenkeeper. Removing empty lines in package.json resolved the problem, for example:

"exclude": [
  "**/node_modules/**",
  "coverage/**",

  "**/*.common-spec.{js|ts}",
  "**/*.spec.{js|ts}",

  "**/*.d.ts",
]

I debugged it with:

# .travis.yml
before_script: greenkeeper-lockfile-update
script: npm test
after_script:
  - git diff --color | cat
  - greenkeeper-lockfile-upload

The git diff showed two removed (empty!) lines in package.json. Indeed, I had two empty lines in there. It seems that during some process (not sure if it is really greenkeeper-lockfile-update) the content of package.json gets completely rewritten, but with a possibly different formatting.