Skip to content

Commit 14a8f2b

Browse files
fix(rush): don't follow-tags on rush version (#5280)
* fix(rush): don't follow-tags on publish Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com> * add changeset Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com> * don't follow tags on rush version not rush publish Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com> --------- Signed-off-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com> Co-authored-by: Aramis Sennyey <aramissennyeydd@users.noreply.github.com>
1 parent 72fde22 commit 14a8f2b

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Improve performance for publishing on filtered clones.",
5+
"type": "none",
6+
"packageName": "@microsoft/rush"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "aramissennyeydd@users.noreply.github.com"
11+
}

libraries/rush-lib/src/cli/actions/VersionAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,14 @@ export class VersionAction extends BaseRushAction {
280280
}
281281

282282
if (changeLogUpdated || packageJsonUpdated) {
283-
await publishGit.pushAsync(tempBranch, !this._ignoreGitHooksParameter.value);
283+
await publishGit.pushAsync(tempBranch, !this._ignoreGitHooksParameter.value, false);
284284

285285
// Now merge to target branch.
286286
await publishGit.fetchAsync();
287287
await publishGit.checkoutAsync(targetBranch);
288288
await publishGit.pullAsync(!this._ignoreGitHooksParameter.value);
289289
await publishGit.mergeAsync(tempBranch, !this._ignoreGitHooksParameter.value);
290-
await publishGit.pushAsync(targetBranch, !this._ignoreGitHooksParameter.value);
290+
await publishGit.pushAsync(targetBranch, !this._ignoreGitHooksParameter.value, false);
291291
await publishGit.deleteBranchAsync(tempBranch, true, !this._ignoreGitHooksParameter.value);
292292
} else {
293293
// skip commits

libraries/rush-lib/src/logic/PublishGit.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ export class PublishGit {
143143
]);
144144
}
145145

146-
public async pushAsync(branchName: string | undefined, verify: boolean = false): Promise<void> {
146+
public async pushAsync(
147+
branchName: string | undefined,
148+
verify: boolean = false,
149+
followTags: boolean = true
150+
): Promise<void> {
147151
await PublishUtilities.execCommandAsync(
148152
!!this._targetBranch,
149153
this._gitPath,
@@ -153,7 +157,7 @@ export class PublishGit {
153157
'push',
154158
'origin',
155159
`HEAD:${branchName || DUMMY_BRANCH_NAME}`,
156-
'--follow-tags',
160+
...(followTags ? ['--follow-tags'] : []),
157161
'--verbose',
158162
...(verify ? [] : ['--no-verify'])
159163
]

0 commit comments

Comments
 (0)