Skip to content

Commit e91c474

Browse files
authored
Merge pull request microsoft#1345 from KRyan/rushChangeMessageFix
[rush] Update message logged by "rush change" when no relevant changes are detected
2 parents b6eb90e + 97f4e6e commit e91c474

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

apps/rush-lib/src/cli/actions/ChangeAction.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class ChangeAction extends BaseRushAction {
113113

114114
this._sortedProjectList = this._getChangedPackageNames().sort();
115115
if (this._sortedProjectList.length === 0) {
116-
console.log('No changes were detected on this branch. Nothing to do.');
116+
this._logNoChangeFileRequired();
117117
this._warnUncommittedChanges();
118118
return Promise.resolve();
119119
}
@@ -147,7 +147,7 @@ export class ChangeAction extends BaseRushAction {
147147
if (changedPackages.length > 0) {
148148
this._validateChangeFile(changedPackages);
149149
} else {
150-
console.log('No changes were detected on this branch.');
150+
this._logNoChangeFileRequired();
151151
}
152152
}
153153

@@ -478,4 +478,8 @@ export class ChangeAction extends BaseRushAction {
478478
FileSystem.writeFile(fileName, output, { ensureFolderExists: true });
479479
console.log(`Created file: ${fileName}`);
480480
}
481+
482+
private _logNoChangeFileRequired(): void {
483+
console.log('No changes were detected to relevant packages on this branch. Nothing to do.');
484+
}
481485
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "When rush change detects no changes, clarify that no *relevant* changes were detected in the case that changes were in a package not versioned by rush'",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "kryan@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)