Glasp → Google Sheets #43
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: "Glasp → Google Sheets" | |
| on: | |
| schedule: | |
| - cron: "0 9 * * *" # Daily at 09:00 UTC – change to your preferred time | |
| workflow_dispatch: # Allow manual trigger from Actions tab | |
| jobs: | |
| export: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check required secrets | |
| id: check | |
| run: | | |
| if [ -z "${{ secrets.GLASP_ACCESS_TOKEN }}" ] || \ | |
| [ -z "${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}" ] || \ | |
| [ -z "${{ secrets.GOOGLE_SHEET_ID }}" ]; then | |
| echo "⚠️ Secrets not configured yet. Skipping workflow." | |
| echo "👉 See README for setup instructions." | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "✅ Secrets found. Proceeding." | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| - name: Set up Python | |
| if: steps.check.outputs.skip != 'true' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| if: steps.check.outputs.skip != 'true' | |
| run: pip install requests cryptography | |
| - name: Run Glasp → Google Sheets | |
| if: steps.check.outputs.skip != 'true' | |
| env: | |
| GLASP_ACCESS_TOKEN: ${{ secrets.GLASP_ACCESS_TOKEN }} | |
| GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} | |
| GOOGLE_SHEET_ID: ${{ secrets.GOOGLE_SHEET_ID }} | |
| PYTHONPATH: scripts | |
| # ── Optional configuration ── | |
| # LOOKBACK_HOURS: "24" # How far back to fetch (default: 24) | |
| # SHEET_TAB: "Highlights" # Sheet tab name (default: Highlights) | |
| run: python scripts/glasp_to_sheets.py |