Skip to content

Main

Main #576

Workflow file for this run

name: Main
on:
schedule:
- cron: "0 1 * * *" # 6:30am IST
workflow_dispatch:
jobs:
fetch:
if: github.ref == 'refs/heads/main'
environment:
name: Github Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: setup python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: install requirements
run: pip install -r scraper/requirements.txt
- name: run github scraper
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: python scraper/src/github.py coronasafe data/github -l DEBUG
on_retry_command: git checkout . # to discard any changes made before retrying
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: run slack scraper
run: python scraper/src/slack.py --lookback_days=2
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: "C04CJHYJR17"
- name: generate md for new contributors
run: node scripts/generateNewContributors.js
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
git add .
git diff --staged --quiet || git commit -am "🌍 Update JSON - $(date -d '+5 hours +30 minutes' +'%d %b %Y | %I:%M %p')"
git push