haskell / actions

Github actions for Haskell CI
147 stars 54 forks source link

Dev: unstaged changes end up in commit in dist/ and lib/ #250

Open andreasabel opened 1 year ago

andreasabel commented 1 year ago

I noticed that if I create or amend a commit while I also have unstaged changes, these will end up against intention in the auto-generated dist/ and lib/ parts of the commit.

https://github.com/haskell/actions/blob/1c618fb42f876960599b42b9d385fc7af930cafb/setup/.lintstagedrc.js#L1-L9

Maybe a fix would be to auto-stash in the commit hook, so that the unstaged changes would not be considered when compiling the typescript. Presumably git stash --keep-index can do this (?): https://stackoverflow.com/questions/20028507/git-stash-uncached-how-to-put-away-all-unstaged-changes