nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.59k stars 2.36k forks source link

Nx Release detected changes to version but when committing there are no files to commit #27707

Closed exequiel09 closed 2 months ago

exequiel09 commented 2 months ago

Current Behavior

When running locally, nx release command can proceed without problems but when running in GH actions, there are instances where it can bump the versions but cannot commit back the changes to the file system even if the changed files package.json is not in the .gitignore

Screenshot 2024-08-30 154727

Expected Behavior

nx release git functionality can successfully call git add and git commit without any problems.

GitHub Repo

No response

Steps to Reproduce

This only happens in GH actions.

  1. Just create some publishable package.
  2. Run the npx nx release --skip-publish in a separate GH action
  3. Run the npx nx release publish in a separate GH action
  4. Make some regular changes just like how a normal package lifecycle

Nx Report

Node           : 22.7.0
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 10.8.2

nx                 : 19.6.4
@nx/js             : 19.6.4
@nx/jest           : 19.6.4
@nx/linter         : 19.6.4
@nx/eslint         : 19.6.4
@nx/workspace      : 19.6.4
@nx/angular        : 19.6.4
@nx/cypress        : 19.6.4
@nx/devkit         : 19.6.4
@nx/eslint-plugin  : 19.6.4
@nx/plugin         : 19.6.4
@nx/rollup         : 19.6.4
@nx/storybook      : 19.6.4
@nrwl/tao          : 19.6.4
@nx/web            : 19.6.4
@nx/webpack        : 19.6.4
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
@nx/storybook/plugin
@nx/rollup/plugin
---------------------------------------
Community plugins:
@ngneat/spectator   : 19.0.0
@ngrx/eslint-plugin : 18.0.2
@rx-angular/cdk     : 18.0.0
@rx-angular/state   : 18.0.0
ngxtension          : 4.0.0
nx-stylelint        : 17.1.5
---------------------------------------

Failure Logs

NX   Staging changed files with git

No files to stage. Skipping git add.

 NX   Committing changes with git

No staged files found. Skipping commit.

Package Manager Version

10.8.2

Operating System

Additional Information

This only happens in GH actions. When run locally, the problem doesn't occur.

exequiel09 commented 2 months ago

Not sure if the output when dry run should be like this

 NX   Staging changed files with git

Would stage files in git with the following command, but --dry-run was set:
git add apps/web/package.json

Instead, I got this (locally):

image

exequiel09 commented 2 months ago

Closing. I got fixed it by removing the release config in the problematic project's project.json file

github-actions[bot] commented 1 month ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.