diff --git a/common/changes/@microsoft/rush/copilot-patch-set-logfilepaths-conditionally_2026-03-20-22-27.json b/common/changes/@microsoft/rush/copilot-patch-set-logfilepaths-conditionally_2026-03-20-22-27.json new file mode 100644 index 00000000000..e5b20c0b1d4 --- /dev/null +++ b/common/changes/@microsoft/rush/copilot-patch-set-logfilepaths-conditionally_2026-03-20-22-27.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Update OperationExecutionRecord to only set `this.logFilePaths` if the value to be assigned is not `undefined`", + "type": "patch" + } + ], + "packageName": "@microsoft/rush" +} diff --git a/libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts b/libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts index 63da9421b54..8ff0034b716 100644 --- a/libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts +++ b/libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts @@ -307,7 +307,9 @@ export class OperationExecutionRecord implements IOperationRunnerContext, IOpera logFilenameIdentifier: `${this._operationMetadataManager.logFilenameIdentifier}${logFileSuffix}` }) : undefined; - this.logFilePaths = logFilePaths; + if (logFilePaths !== undefined) { + this.logFilePaths = logFilePaths; + } const projectLogWritable: TerminalWritable | undefined = logFilePaths ? await initializeProjectLogFilesAsync({