Skip to content

DM Bot Poll

DM Bot Poll #1371

Workflow file for this run

name: DM Bot Poll
on:
schedule:
- cron: '*/2 * * * *'
workflow_dispatch:
jobs:
poll:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: dm-bot-poll
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install deps
run: pip install -r requirements.txt
- name: Build .env from secrets
run: |
echo "IG_USER_ID=${{ secrets.IG_USER_ID }}" >> .env
echo "IG_LONG_LIVED_TOKEN=${{ secrets.IG_LONG_LIVED_TOKEN }}" >> .env
echo "IG_HANDLE=${{ secrets.IG_HANDLE || 'aashirathar' }}" >> .env
- name: Poll comments
run: python bot_comments.py
- name: Poll DMs
run: python bot_dms.py
- name: Commit state
run: |
git config user.name "dm-bot"
git config user.email "bot@noreply.github.com"
git add state.json
git diff --staged --quiet || git commit -m "state: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
git push