Skip to content

Commit d0139f5

Browse files
committed
ci: 🚧 clear cache once a month and manual run πŸš€
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
1 parent bed7ed4 commit d0139f5

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
name: Clear cache
3+
4+
on:
5+
schedule:
6+
- cron: '0 0 1 * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
actions: write
11+
12+
jobs:
13+
clear-cache:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Clear cache
17+
uses: actions/github-script@v6
18+
with:
19+
script: |
20+
console.log("About to clear")
21+
const caches = await github.rest.actions.getActionsCacheList({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
})
25+
for (const cache of caches.data.actions_caches) {
26+
console.log(cache)
27+
github.rest.actions.deleteActionsCacheById({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
cache_id: cache.id,
31+
})
32+
}
33+
console.log("Clear completed")

β€Ž.github/workflows/test.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
uses: actions/checkout@v3
1616
- name: 🐍 Set up Python ${{ matrix.python-version }}
1717
uses: actions/setup-python@v4
18+
#Β id based on python version
19+
id: python-setup
1820
with:
1921
python-version: ${{ matrix.python-version }}
2022
check-latest: true

0 commit comments

Comments
Β (0)