File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments