Skip to content
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

Fix cache cleanup script (now tested to work) #999

Merged
merged 6 commits into from
Feb 12, 2024

Conversation

corneliusroemer
Copy link
Contributor

@corneliusroemer corneliusroemer commented Feb 12, 2024

Fixing the cleanup-cache action.

Background

Unfortunately the script as shown in Github docs doesn't work

https://github.com/loculus-project/loculus/actions/runs/7873524962/job/21481061540

gh extension install actions/gh-actions-cache
  
  echo "Fetching list of cache key"
  cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
  
  ## Setting this to not fail the workflow while deleting cache keys.
  set +e
  echo "Deleting caches..."
  for cacheKey in $cacheKeysForPR
  do
      gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
  done
  echo "Done"
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***
    REPO: loculus-project/loculus
    BRANCH: refs/pull/98[4](https://github.com/loculus-project/loculus/actions/runs/7873524962/job/21481061540#step:2:4)/merge
Fetching list of cache key
Error: Resource not accessible by integration
Deleting caches...
Done

Testing

Can be tested with:

gh workflow run --ref corneliusroemer-patch-1 

@corneliusroemer corneliusroemer marked this pull request as draft February 12, 2024 14:56
@corneliusroemer corneliusroemer marked this pull request as ready for review February 12, 2024 15:47
@corneliusroemer corneliusroemer changed the title Add some debug logging to cache cleanup script Fix cache cleanup script (now tested to work) Feb 12, 2024
@corneliusroemer corneliusroemer merged commit cc80095 into main Feb 12, 2024
1 check passed
@corneliusroemer corneliusroemer deleted the corneliusroemer-patch-1 branch February 12, 2024 16:24
@corneliusroemer
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants