Skip to content

Commit

Permalink
Trim cache key based on LINES env
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Aug 7, 2024
1 parent 0b3a946 commit d57a204
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/prune-actions-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
LINES: 30
REPO: ${{ github.repository }}

jobs:
Expand Down
3 changes: 2 additions & 1 deletion tools/prune-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@

$exitCode = 0;
$result = [];
$lines = getenv('LINES') === false ? 50 : (int) getenv('LINES');
$message = sprintf(
"Deleting cache \033[33m%s\033[0m (\033[31m%s MB\033[0m) on ref \033[32m%s\033[0m...\n",
substr($cache['key'], 0, 50),
substr($cache['key'], 0, $lines),
number_format($cache['size_in_bytes'] / 1_000_000, 2),
$cache['ref'],
);
Expand Down

0 comments on commit d57a204

Please sign in to comment.