Google Drive Cleanup (monthly) #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Google Drive Cleanup (monthly) | |
| on: | |
| schedule: | |
| - cron: "0 0 1 * *" # Runs at 00:00 UTC on the 1st of each month | |
| workflow_dispatch: | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install Google API dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade google-api-python-client google-auth google-auth-httplib2 google-auth-oauthlib | |
| - name: Decode Drive credentials | |
| run: | | |
| echo "${{ secrets.DRIVE_CREDENTIALS }}" | base64 -d > sa.json | |
| - name: Run cleanup script | |
| run: | | |
| python scripts/gdrive_old_files_cleanup.py | |
| echo "✅ Google Drive cleanup completed" |