Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detected uncommitted changes after build. #528

Closed
kenhowardpdx opened this issue May 18, 2022 · 3 comments · Fixed by #732
Closed

Detected uncommitted changes after build. #528

kenhowardpdx opened this issue May 18, 2022 · 3 comments · Fixed by #732
Assignees

Comments

@kenhowardpdx
Copy link

When dependabot bumps the version of dependencies, I routinely get this failure:

Detected uncommitted changes after build.  See status below:
[18](https://github.com/kenhowardpdx/auto-merge-action/runs/6497746695?check_suite_focus=true#step:6:19)
diff --git a/dist/index.js.map b/dist/index.js.map
[19](https://github.com/kenhowardpdx/auto-merge-action/runs/6497746695?check_suite_focus=true#step:6:20)
index f236678..ef8f2d5 100644
[20](https://github.com/kenhowardpdx/auto-merge-action/runs/6497746695?check_suite_focus=true#step:6:21)
Binary files a/dist/index.js.map and b/dist/index.js.map differ

The map file is not necessary for the operation of the action. It would be better if it wasn't included in the package process.

@SayakMukhopadhyay
Copy link
Contributor

This might be similar to an issue I have been facing. I have noticed that my "Check dist/" workflow never passes and the reason for their failure is that one or more binary files in the dist folders differ.

I have noticed that the .gitattributes file in the project marks the content of the dist folder to be binary for git. And it seems like git is handling the ignoring of line endings differently in Windows and Linux. Note that this is not an issue with the EOL character as in my case I always use LF.

In my case, doing at git diff in Windows shows no changes whereas doing a git diff in WSL based Ubuntu shows changes in the files in the dist folder. I am not sure if this is an issue with the project or git itself.

Removing the contents of the .gitattributes files no longer shows this issue.

@SayakMukhopadhyay
Copy link
Contributor

SayakMukhopadhyay commented Oct 9, 2022

So, I did a bit more testing this morning and figured out the root cause. Seems like npm run package is generating an index.js file with mixed line endings. I have core.autocrlf=input set in my .gitconfig in Windows but not in WSL and hence the difference in experience.

It seems like the --ignore-space-at-eol flag doesn't work with files marked as binary. So, if I do git diff --ignore-space-at-eol --text dist/, it shows me there to be no difference and not using the --text flag shows my some difference.

Alternatively, setting core.autocrlf=true also doesn't show any difference.

@ncalteen
Copy link
Collaborator

Hello! Apologies for the delay in responding to this issue. I have a few changes staged in #732 that should hopefully help :)

  • Remove sourcemap-register from the bundle outputs in dist/
  • Fixed the issue in the check-dist workflow that flags CRLF/LF differences (thank you @SayakMukhopadhyay!)

I will mark this issue as closed when the PR is merged. If you have any questions, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants