-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.08 KB
/
sync.yml
File metadata and controls
44 lines (36 loc) · 1.08 KB
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
name: Weekly Data Sync
on:
schedule:
- cron: '0 6 * * 0' # Sunday midnight MT (6 AM UTC)
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run sync
env:
OPENSTATES_API_KEY: ${{ secrets.OPENSTATES_API_KEY }}
LEGISCAN_API_KEY: ${{ secrets.LEGISCAN_API_KEY }}
run: python scripts/sync.py
- name: Validate data
run: python scripts/validate.py
- name: Commit and push if changed
run: |
git config user.name "Nina Rivera"
git config user.email "55598663+nina-coder@users.noreply.github.com"
git add data/
if git diff --cached --quiet; then
echo "No data changes"
else
git commit -m "data: weekly sync $(date +%Y-%m-%d)"
git push
fi