Glasp → Slack #44
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 → Slack" | |
| 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.SLACK_WEBHOOK_URL }}" ]; 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 | |
| - name: Run Glasp → Slack | |
| if: steps.check.outputs.skip != 'true' | |
| env: | |
| GLASP_ACCESS_TOKEN: ${{ secrets.GLASP_ACCESS_TOKEN }} | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| PYTHONPATH: scripts | |
| # ── Optional configuration ── | |
| # LOOKBACK_HOURS: "24" # How far back to fetch (default: 24) | |
| # MAX_DOCS: "5" # Max documents per run (default: 5) | |
| # MAX_HIGHLIGHTS_PER_DOC: "10" # Max highlights per doc (default: 10) | |
| run: python scripts/glasp_to_slack.py |