-
Notifications
You must be signed in to change notification settings - Fork 38
58 lines (49 loc) · 1.61 KB
/
scraper.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Main
on:
schedule:
- cron: "0 1 * * *" # 6:30am IST
workflow_dispatch:
permissions:
issues: read
pull-requests: read
jobs:
fetch-data:
name: Scrap data from GitHub and Slack
if: github.ref == 'refs/heads/main'
environment:
name: Open Healthcare Network
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r scraper/requirements.txt
- name: Scrap GitHub data
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: python scraper/src/github.py ${{ github.repository_owner }} data/github -l DEBUG
on_retry_command: git checkout .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Scrap EOD updates from Slack
if: ${{ env.SLACK_API_TOKEN }}
run: python scraper/src/slack.py --lookback_days=2
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_CHANNEL: ${{ vars.SLACK_EOD_CHANNEL }}
- name: Generate markdown files for new contributors
run: node scripts/generateNewContributors.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "🌍 Update JSON - $(date -d '+5 hours +30 minutes' +'%d %b %Y | %I:%M %p')"
git push