diff --git a/.github/workflows/clear-cache.yml b/.github/workflows/clear-cache.yml new file mode 100644 index 00000000..76aed5cf --- /dev/null +++ b/.github/workflows/clear-cache.yml @@ -0,0 +1,33 @@ + +name: Clear cache + +on: + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +permissions: + actions: write + +jobs: + clear-cache: + runs-on: ubuntu-latest + steps: + - name: Clear cache + uses: actions/github-script@v6 + with: + script: | + console.log("About to clear") + const caches = await github.rest.actions.getActionsCacheList({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + for (const cache of caches.data.actions_caches) { + console.log(cache) + github.rest.actions.deleteActionsCacheById({ + owner: context.repo.owner, + repo: context.repo.repo, + cache_id: cache.id, + }) + } + console.log("Clear completed") diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89caaf5a..cd151b02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,8 @@ jobs: uses: actions/checkout@v3 - name: 🐍 Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 + # id based on python version + id: python-setup with: python-version: ${{ matrix.python-version }} check-latest: true