Skip to content

Misc - Remove cache #173

Misc - Remove cache

Misc - Remove cache #173

name: Misc - Remove cache
on:
workflow_dispatch:
workflow_run:
workflows:
- Application - Test
types:
- completed
jobs:
misc-remove_cache:
runs-on: ubuntu-latest
steps:
# remove cache older than 1 hour ago
- run:
for ID in $(gh cache list --repo ${{ github.repository }} --json id,createdAt | jq ".[].createdAt |= (sub(\"\\\\..*Z\";\"Z\") | fromdateiso8601 < `expr $(date +%s) - 60 \* 60`)" | jq -r '.[].id');
do gh cache delete --repo ${{ github.repository }} $ID;
done
env:
GH_TOKEN: ${{ github.token }}