File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
.github/actions/install-dependencies Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 55 cache_key :
66 description : ' The dependency cache key'
77 value : ${{ steps.compute_lockfile_hash.outputs.hash }}
8+ cache_key_all :
9+ description : ' The dependency cache key without hashing'
10+ value : ${{ steps.compute_lockfile_hash.outputs.nohash }}
811
912runs :
1013 using : ' composite'
2023 with :
2124 path : ${{ env.CACHED_DEPENDENCY_PATHS }}
2225 key : ${{ steps.compute_lockfile_hash.outputs.hash }}
26+ key-nohash : ${{ steps.compute_lockfile_hash.outputs.nohash }}
2327
2428 - name : Install dependencies
2529 if : steps.cache_dependencies.outputs.cache-hit != 'true'
Original file line number Diff line number Diff line change @@ -32,11 +32,17 @@ function outputDependencyCacheKey() {
3232 hashParts . push ( getNormalizedDependencies ( packageJson , workspacePackageNames ) ) ;
3333 } ) ;
3434
35- const hash = crypto . createHash ( 'md5' ) . update ( hashParts . join ( '\n' ) ) . digest ( 'hex' ) ;
36- // We log the output in a way that the GitHub Actions can append it to the output
37- // We prefix it with `dependencies-` so it is easier to identify in the logs
38- // eslint-disable-next-line no-console
35+ // Create a truncated version of the raw data for debugging
36+ // We don't want to output the full content as it could be very large
37+ const rawData = hashParts . join ( '\n' ) ;
38+ const truncatedRawData =
39+ rawData . length > 500 ? rawData . substring ( 0 , 250 ) + '...' + rawData . substring ( rawData . length - 250 ) : rawData ;
40+
41+ const hash = crypto . createHash ( 'md5' ) . update ( rawData ) . digest ( 'hex' ) ;
42+
43+ // Output both the hash and the raw data (truncated)
3944 console . log ( `hash=dependencies-${ hash } ` ) ;
45+ console . log ( `nohash=${ encodeURIComponent ( truncatedRawData ) } ` ) ;
4046}
4147
4248function getNormalizedDependencies ( packageJson , workspacePackageNames ) {
You can’t perform that action at this time.
0 commit comments