Zoom Transcript Poller #885
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: "Zoom Transcript Poller" | |
on: | |
workflow_dispatch: | |
inputs: | |
FORCE_MEETING_ID: | |
description: "Optional: Force processing of a specific Zoom meeting ID (requires FORCE_ISSUE_NUMBER)" | |
required: false | |
FORCE_ISSUE_NUMBER: | |
description: "Optional: Force processing for a specific occurrence (requires FORCE_MEETING_ID)" | |
required: false | |
type: string # Use string type, the script handles parsing to int | |
schedule: | |
- cron: "0 */6 * * *" # Run every 6 hours at minute 0 | |
jobs: | |
poll-transcripts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -e .github/ACDbot/ | |
pip install pytz google-api-python-client | |
pip install -r .github/ACDbot/requirements.txt | |
- name: Poll Zoom for recordings | |
run: | | |
if [ -n "${{ github.event.inputs.FORCE_MEETING_ID }}" ] && [ -n "${{ github.event.inputs.FORCE_ISSUE_NUMBER }}" ]; then | |
python .github/ACDbot/scripts/poll_zoom_recordings.py \ | |
--force_meeting_id "${{ github.event.inputs.FORCE_MEETING_ID }}" \ | |
--force_issue_number "${{ github.event.inputs.FORCE_ISSUE_NUMBER }}" | |
elif [ -n "${{ github.event.inputs.FORCE_MEETING_ID }}" ]; then | |
python .github/ACDbot/scripts/poll_zoom_recordings.py \ | |
--force_meeting_id "${{ github.event.inputs.FORCE_MEETING_ID }}" | |
else | |
python .github/ACDbot/scripts/poll_zoom_recordings.py | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Zoom credentials | |
ZOOM_CLIENT_ID: ${{ secrets.ZOOM_CLIENT_ID }} | |
ZOOM_CLIENT_SECRET: ${{ secrets.ZOOM_CLIENT_SECRET }} | |
ZOOM_REFRESH_TOKEN: ${{ secrets.ZOOM_REFRESH_TOKEN }} | |
# Discourse credentials | |
DISCOURSE_API_KEY: ${{ secrets.DISCOURSE_API_KEY }} | |
DISCOURSE_API_USERNAME: ${{ secrets.DISCOURSE_API_USERNAME }} | |
DISCOURSE_BASE_URL: ${{ vars.DISCOURSE_BASE_URL }} | |
# Telegram credentials | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
TELEGRAM_CHAT_ID: ${{ vars.TELEGRAM_CHAT_ID }} | |
- name: Commit mapping file | |
if: always() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
if git diff --quiet .github/ACDbot/meeting_topic_mapping.json; then | |
echo "No changes to mapping file" | |
else | |
git add .github/ACDbot/meeting_topic_mapping.json | |
git commit -m "Update meeting-topic mapping" | |
git push | |
echo "Committed mapping file changes" | |
fi |