Skip to content

Commit aab83dc

Browse files
authored
Add monthly Google Drive cleanup workflow
1 parent 07678da commit aab83dc

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Google Drive Cleanup (monthly)
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 1 * *" # Runs at 00:00 UTC on the 1st of each month
6+
workflow_dispatch:
7+
8+
jobs:
9+
cleanup:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install Google API dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install --upgrade google-api-python-client google-auth google-auth-httplib2 google-auth-oauthlib
26+
27+
- name: Decode Drive credentials
28+
run: |
29+
echo "${{ secrets.DRIVE_CREDENTIALS }}" | base64 -d > sa.json
30+
31+
- name: Run cleanup script
32+
run: |
33+
python gdrive_old_files_cleanup.py
34+
echo "✅ Google Drive cleanup completed"

0 commit comments

Comments
 (0)