Skip to content

Commit a495539

Browse files
ci: output build cache hit rate as GHA annotation (#50368)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
1 parent bd193de commit a495539

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

script/build-stats.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ async function main () {
3232
}));
3333
const hitRate = stats.CacheHit / (stats.Remote + stats.CacheHit + stats.LocalFallback);
3434

35-
console.log(`Effective cache hit rate: ${(hitRate * 100).toFixed(2)}%`);
35+
const messagePrefix = process.env.GITHUB_ACTIONS ? '::notice title=Build Stats::' : '';
36+
console.log(`${messagePrefix}Effective cache hit rate: ${(hitRate * 100).toFixed(2)}%`);
3637

3738
if (uploadStats) {
3839
if (!process.env.DD_API_KEY) {

0 commit comments

Comments
 (0)