-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GHA] Cache cleanup workload #19851
[GHA] Cache cleanup workload #19851
Conversation
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do | ||
if [[ ! -z "$CACHE_KEY" ]] | ||
then | ||
gh actions-cache delete $CACHE_KEY -R $REPO -B $BRANCH --confirm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding some logging, e.g.: echo "DELETING CACHE KEY: $CACHE_KEY"
just for the easier possible debug.
for KEY in ${KEYS[@]} | ||
do | ||
echo "Fetching list of cache with key ${KEY} for ${BRANCH}" | ||
CACHE_KEYS=( $(gh actions-cache list -R $REPO -B $BRANCH -L 100 --key $KEY --sort created-at --order desc | cut -f 1) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enclosed in ()
for readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no to initialize variable as array
if: github.event.pull_request.merged == true | ||
env: | ||
BRANCH: master | ||
KEYS: "ccache-linux-ubuntu ccache-Build-linux-debian ccache-Build-linux-android ccache-Build-linux-arm64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they find the cache entries with timestamps in them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it finds all entries including entries with timestamps
Details:
Tickets: