Current Behavior
When running the top-level nx release command with --groups=… (no --projects= flag) on a config that uses fixed release groups with a per-group changelog.file, the generated changelog files are written to disk but not staged into the release commit. Only the package.json updates from the version phase end up in the release commit; the CHANGELOG.md files for each affected group remain dirty in the working tree and are discarded when CI tears down.
The log shows two related symptoms:
-
Per-project iteration inside fixed groups. For a fixed group with N projects sharing one changelog.file, the log emits N Generating an entry in <file> for <group>@v<version> lines. The first iteration writes; subsequent iterations log NOTE: There was no diff detected for the changelog entry.
-
Final summary incorrectly reports no changes. After several files have been UPDATEd / CREATEd in the per-group iteration, the run still prints:
NX No changes detected for changelogs
No changes were detected for any changelog files, so no changelog entries will be generated.
The release commit then contains only the version-phase package.json writes; the changelog files never make it into the index.
Expected Behavior
When nx release writes one or more per-group changelog/<group>/CHANGELOG.md files during the changelog phase, those files should be staged into the same release commit as the package.json version bumps.
Steps to Reproduce
-
Initialize an Nx workspace with two libraries that match a wildcard, e.g. domain-feature-a and providers-feature-a.
-
Configure a fixed release group sharing a per-group changelog file. Minimal nx.json:
{
"release": {
"git": { "commitMessage": "chore: updated version [no ci]" },
"version": { "conventionalCommits": true },
"changelog": {
"workspaceChangelog": false,
"projectChangelogs": true
},
"groups": {
"feature-a": {
"projects": ["*-feature-a"],
"projectsRelationship": "fixed",
"releaseTag": { "pattern": "feature-a@v{version}" },
"changelog": {
"file": "changelog/feature-a/CHANGELOG.md",
"createRelease": "github"
},
"version": { "conventionalCommits": true }
}
}
}
}
-
Tag a starting version: git tag feature-a@v1.0.0.
-
Add a conventional commit that affects one of the projects in the group:
fix(feature-a): trigger a patch bump
-
Run the top-level release command (no --projects=):
nx release --groups=feature-a --skip-publish
-
Inspect the resulting release commit:
Observed:
- The console log shows
UPDATE changelog/feature-a/CHANGELOG.md once (with the new entry diff), then a second Generating an entry in changelog/feature-a/CHANGELOG.md for feature-a@v1.0.1 followed by NOTE: There was no diff detected for the changelog entry.
- The final summary prints
[NX] No changes detected for changelogs / No changelog entries will be generated.
git show HEAD --stat lists only the two package.json files. changelog/feature-a/CHANGELOG.md is dirty in the working tree but not in the commit.
Nx Report
(output of `nx report` from the affected workspace)
Node : 20.x
OS : linux x64
Native Target : x86_64-linux
nx : 22.5.2
@nx/js : 22.5.2
@nx/workspace : 22.5.2
Failure Logs
NX Staging changed files with git # version phase only — package.json files
NX Generating an entry in changelog/feature-a/CHANGELOG.md for feature-a@v1.0.1
UPDATE changelog/feature-a/CHANGELOG.md
+ ## 1.0.1 (...)
+
+ ### 🩹 Fixes
+
+ - **feature-a:** trigger a patch bump
NX Generating an entry in changelog/feature-a/CHANGELOG.md for feature-a@v1.0.1
NOTE: There was no diff detected for the changelog entry. Maybe you intended to pass alternative git references via --from and --to?
NX No changes detected for changelogs
No changes were detected for any changelog files, so no changelog entries will be generated.
NX Committing changes with git
NX Tagging commit with git
NX Pushing to git remote "origin"
Resulting commit:
$ git show HEAD --stat
chore: updated version [no ci]
packages/domain-feature-a/package.json | 2 +-
packages/providers-feature-a/package.json | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Package Manager Version
bun 1.3.10 (also reproduced with npm; not package-manager-specific.)
Operating System
Additional Information
Related prior reports:
Current Behavior
When running the top-level
nx releasecommand with--groups=…(no--projects=flag) on a config that uses fixed release groups with a per-groupchangelog.file, the generated changelog files are written to disk but not staged into the release commit. Only thepackage.jsonupdates from the version phase end up in the release commit; theCHANGELOG.mdfiles for each affected group remain dirty in the working tree and are discarded when CI tears down.The log shows two related symptoms:
Per-project iteration inside fixed groups. For a fixed group with N projects sharing one
changelog.file, the log emits NGenerating an entry in <file> for <group>@v<version>lines. The first iteration writes; subsequent iterations logNOTE: There was no diff detected for the changelog entry.Final summary incorrectly reports no changes. After several files have been
UPDATEd /CREATEd in the per-group iteration, the run still prints:The release commit then contains only the version-phase
package.jsonwrites; the changelog files never make it into the index.Expected Behavior
When
nx releasewrites one or more per-groupchangelog/<group>/CHANGELOG.mdfiles during the changelog phase, those files should be staged into the same release commit as thepackage.jsonversion bumps.Steps to Reproduce
Initialize an Nx workspace with two libraries that match a wildcard, e.g.
domain-feature-aandproviders-feature-a.Configure a fixed release group sharing a per-group changelog file. Minimal
nx.json:{ "release": { "git": { "commitMessage": "chore: updated version [no ci]" }, "version": { "conventionalCommits": true }, "changelog": { "workspaceChangelog": false, "projectChangelogs": true }, "groups": { "feature-a": { "projects": ["*-feature-a"], "projectsRelationship": "fixed", "releaseTag": { "pattern": "feature-a@v{version}" }, "changelog": { "file": "changelog/feature-a/CHANGELOG.md", "createRelease": "github" }, "version": { "conventionalCommits": true } } } } }Tag a starting version:
git tag feature-a@v1.0.0.Add a conventional commit that affects one of the projects in the group:
Run the top-level release command (no
--projects=):Inspect the resulting release commit:
Observed:
UPDATE changelog/feature-a/CHANGELOG.mdonce (with the new entry diff), then a secondGenerating an entry in changelog/feature-a/CHANGELOG.md for feature-a@v1.0.1followed byNOTE: There was no diff detected for the changelog entry.[NX] No changes detected for changelogs / No changelog entries will be generated.git show HEAD --statlists only the twopackage.jsonfiles.changelog/feature-a/CHANGELOG.mdis dirty in the working tree but not in the commit.Nx Report
Failure Logs
Resulting commit:
Package Manager Version
bun 1.3.10 (also reproduced with npm; not package-manager-specific.)
Operating System
Additional Information
Related prior reports:
@nx/release: duplicated projects #33268 —@nx/release: duplicated projects (manifests when using--projects=).new Set(...)dedupe, but only inside theargs.projects?.lengthcode branch inpackages/nx/src/command-line/release/changelog.ts. The--groups=(default) branch does not pass through that dedupe, which is consistent with the duplicate per-project iteration we still observe on 22.5.2 and onmaster.