Skip to content

fix(ng-dev/release): allow empty commits when publishing snapshots#3534

Merged
alan-agius4 merged 1 commit intoangular:mainfrom
alan-agius4:skip-commit-if-no-changes
Mar 13, 2026
Merged

fix(ng-dev/release): allow empty commits when publishing snapshots#3534
alan-agius4 merged 1 commit intoangular:mainfrom
alan-agius4:skip-commit-if-no-changes

Conversation

@alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Mar 13, 2026

When publishing snapshots, it's possible that a package is built but
contains no functional changes (e.g. only version placeholder updates
which are ignored by the diff).
Previously, the git commit step would fail in these cases because the
working tree was clean. This change adding the --allow-empty flag to
ensure the commit succeeds regardless of changes.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses an issue where git commit would fail during snapshot publishing if no changes were detected. By adding a check for changes before attempting to commit, the change prevents potential errors. My review includes a suggestion to improve how the commit message is passed to Git, ensuring it's formatted correctly without unnecessary quotes.

@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Mar 13, 2026
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than selecting running the git commit command we should --allow-empty for cases where we do want it to publish regardless of whether its changed.

For instance in angular/angular, we always want it to publish since we want to have a snapshot of all of the packages, not just the changed ones for a given commit.

@alan-agius4 alan-agius4 changed the title fix(ng-dev/release): skip commit in snapshot repository if no changes are detected fix(ng-dev/release): allow empty commits when publishing snapshots Mar 13, 2026
When publishing snapshots, it's possible that a package is built but
contains no functional changes (e.g. only version placeholder updates
which are ignored by the diff).

Previously, the git commit step would fail in these cases because the
working tree was clean. This change adds the --allow-empty flag to
ensure the commit succeeds regardless of changes.
@alan-agius4 alan-agius4 force-pushed the skip-commit-if-no-changes branch from 800126f to e1c1427 Compare March 13, 2026 13:39
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alan-agius4 alan-agius4 merged commit 7cc2bdd into angular:main Mar 13, 2026
13 checks passed
@alan-agius4
Copy link
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the skip-commit-if-no-changes branch March 13, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants