@@ -83,16 +83,17 @@ export class BridgeCachePlugin implements IRushPlugin {
8383 ) : Promise < void > => {
8484 const { buildCacheConfiguration } = context ;
8585 const { terminal } = logger ;
86+
87+ if ( cacheAction === undefined ) {
88+ return ;
89+ }
90+
8691 if ( ! buildCacheConfiguration ?. buildCacheEnabled ) {
8792 throw new Error (
8893 `The build cache must be enabled to use the "${ this . _actionParameterName } " parameter.`
8994 ) ;
9095 }
9196
92- if ( cacheAction === undefined ) {
93- return ;
94- }
95-
9697 const filteredOperations : Set < IOperationExecutionResult > = new Set ( ) ;
9798 for ( const operationExecutionResult of recordByOperation . values ( ) ) {
9899 if ( ! operationExecutionResult . operation . isNoOp ) {
@@ -122,6 +123,7 @@ export class BridgeCachePlugin implements IRushPlugin {
122123 terminal . writeLine (
123124 `Operation "${ operation . name } ": Outputs have been restored from the build cache."`
124125 ) ;
126+ terminal . writeLine ( `Cache key: ${ projectBuildCache . cacheId } ` ) ;
125127 } else {
126128 terminal . writeWarningLine (
127129 `Operation "${ operation . name } ": Outputs could not be restored from the build cache.`
@@ -155,6 +157,7 @@ export class BridgeCachePlugin implements IRushPlugin {
155157 terminal . writeLine (
156158 `Operation "${ operation . name } ": Existing outputs have been successfully written to the build cache."`
157159 ) ;
160+ terminal . writeLine ( `Cache key: ${ projectBuildCache . cacheId } ` ) ;
158161 } else {
159162 terminal . writeErrorLine (
160163 `Operation "${ operation . name } ": An error occurred while writing existing outputs to the build cache.`
@@ -179,6 +182,7 @@ export class BridgeCachePlugin implements IRushPlugin {
179182 const cacheActionParameter : CommandLineParameter | undefined = context . customParameters . get (
180183 this . _actionParameterName
181184 ) ;
185+
182186 if ( cacheActionParameter ) {
183187 if ( cacheActionParameter . kind !== CommandLineParameterKind . Choice ) {
184188 throw new Error (
0 commit comments