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

The action regenerates the yarn.lock file and commit it to VCS #252

Open
virtyaluk opened this issue Aug 16, 2024 · 10 comments · May be fixed by #257
Open

The action regenerates the yarn.lock file and commit it to VCS #252

virtyaluk opened this issue Aug 16, 2024 · 10 comments · May be fixed by #257

Comments

@virtyaluk
Copy link

Hello there! Long story short. I use Yarn 4, monorepo, and Yarn Workspaces to manage a handful of web projects in a single code base. Every time this action runs, it updates the package.json file and regenerates the yarn.lock file using Yarn 1 specification (instead of my project's Yarn 4) and commit the changes back to the version control. This is an unwanted side-effect that breaks parts of my code. I'd like to see this action commit only necessary files and avoid touching anything else. Is that possible? Thanks.

image
@phips28
Copy link
Owner

phips28 commented Aug 19, 2024

I would appreciate if you could do a PR for that 🙂

@phips28
Copy link
Owner

phips28 commented Aug 19, 2024

have you tried this: actions/setup-node#904 (comment)

      - name: Enable Corepack
        run: corepack enable

@felpsio felpsio linked a pull request Nov 11, 2024 that will close this issue
@felpsio
Copy link

felpsio commented Nov 11, 2024

Made some simples changes to remove this lock files. Until the PR is merged or someone makes a better commit, you can just use my fork (felpsio/gh-action-bump-version)

@phips28
Copy link
Owner

phips28 commented Nov 11, 2024

have you tried setting another yarn version? #252 (comment)

@felpsio
Copy link

felpsio commented Nov 12, 2024

I'm currently using yarn 3.2 with workspaces. And was still getting the lockfile problem.

@gamalielmendez
Copy link

Hi, I have the same problem. I have a workspace with Yarn 1.22.22. I tried using felpsio/gh-action-bump-version@master, but it still modifies the yarn.lock. I hope you can help me.

@felpsio
Copy link

felpsio commented Nov 18, 2024

@gamalielmendez weird, I've been able to use my version in prod without problems.

Have you checked if the change in yarn.lock in your case was only your local packages version bump? Or are you getting a big diff from your lock files as well?

@gamalielmendez
Copy link

gamalielmendez commented Nov 18, 2024

It is modifying the package URLs to some from npm.
image
Do I have any errors in my configuration?
image

thanks for responding @felpsio

@felpsio
Copy link

felpsio commented Nov 20, 2024

gamalielmendez your problem seems to be related to yarn/npm problem. If you notice, the action is running npm install while you're using yarn in your project.

You probably have both package-lock.json and yarn.lock in your project. If you decide to go with yarn and remove the package-lock.json in your project may solve the problem.

anyway... if this doesn't work you probably investigate if there is any relation with npm/yarn.

@felpsio
Copy link

felpsio commented Nov 27, 2024

found some problems with my early code and fixed. If anyone else needs to use it, may work better now.

the branch is quite messy while I was testing. So I made my PR a draft one so it won't mess with the current branch story. But it may help with inspiration to solve the problem at the official branch now.

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

Successfully merging a pull request may close this issue.

4 participants