-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Prevent merge of unsynchronized yarn.lock
files
#30052
Comments
yarn.lock
files
GitHub Actions has a similar issue and https://github.com/cypress-io/github-action/blob/master/.github/workflows/check-dist.yml is used to check for unresolved changes. That would be something like the following, added into the CI workflow at some point after if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
echo yarn.lock mismatch
git diff
exit 1
fi |
Yah, seems reasonable to have something in place since this keeps happening. |
This comment was marked as outdated.
This comment was marked as outdated.
|
|
I did actually consider this when I started making changes. I ended up stashing the changes. I then ran Was there something I could have done differently? I would like to make sure that for any future changes I make that this won't be a burden on anyone. |
The final state of your branch looks completely correct to me, so please don't worry that you did something wrong! This issue is about improving the process to catch any mismatch issues caused by whatever reason. If there is a mismatch there should be a warning, however there wasn't a warning. I only noticed the problem when I was preparing a new PR and ran
|
@MikeMcC399 |
What would you like?
The
develop
branch should be protected against merging commits with unsynchronized yarn.lock files.Running
yarn
on any commit in thedevelop
branch, or destined for this branch, should not produce any differences inyarn.lock
.Why is this needed?
If commits with unsynchronized
yarn.lock
files are merged into thedevelop
branch then follow-on PRs are forced into cleaning up the mismatch of their predecessor(s) leading to a confusing change history.Other
Examples of PRs merged with unsynchronized
yarn.lock
files:Renovate
See
yarn.lock
with mismatched lockfile #30051Examples caused by Renovate:
Manual error
Caused by manual change to a dependency in a
package.json
file without runningyarn
:The text was updated successfully, but these errors were encountered: