Open agepalmist opened 7 months ago
: cleanup caches by a branch on: pull_request: types:
jobs: cleanup: runs-on: ubuntu-latest steps:
name: Cleanup run: | 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"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
: cleanup caches by a branch on: pull_request: types:
jobs: cleanup: runs-on: ubuntu-latest steps:
name: Cleanup run: | 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"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
Hello @poiupoiu17990 as far as I understood this extension doesn't allow to use of a cache, only to list or delete. The question was how to use it.
BTW, for a GHES it requires GH_ENTERPRISE_TOKEN and GH_HOST definition instead of GH_TOKEN.
env:
GH_ENTERPRISE_TOKEN: ${{ github.token }}
GH_HOST: 'git.custom-host.com'
run: |
gh extension install https://github.com/actions/gh-actions-cache
gh actions-cache list
@agepalmist Did you ever find a solution?
Setting the environment variable NODE_EXTRA_CA_CERTS
to /etc/ssl/certs/ca-certificates.crt
(ubuntu) solved the issue for me.
@agepalmist Did you ever find a solution?
was done by the GH runners management team, the cache wasn't provided deliberately in my case :)
Dear team, I apologise if I'm in the wrong place. Couldn't find any relevant link. Trying to use actions/cache@3 or actions/cache/restore@v3 got this message:![image](https://github.com/actions/cache/assets/76492166/be51edbe-8f0a-4a0c-bcbb-146c44d5e381)
The cache was saved with a separate workflow and on the place.![image](https://github.com/actions/cache/assets/76492166/dfd9b607-35df-479b-857c-63cb83c0538a)
GitHub Enterprise Server 3.8.8
Runs-on: self-hosted
Might it be a runner settings issue related? Could you please give me a hint on how to resolve this? Thanks in advance. Regards, Denis.