-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (34 loc) · 1.5 KB
/
update_legislative_support.yml
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: Update Legislative Support
on:
workflow_dispatch: # This enables manual triggering from the GitHub UI
jobs:
update-legislation-info:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LEGISLATIVE_SUPPORT: ${{ secrets.LEGISLATIVE_SUPPORT }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Specify the Python version if needed
- name: Install dependencies
run: |
pip install -r requirements.txt # If you have dependencies
- name: Run legislative_support_generator.py
run: python scripts/legislative_support_generator.py
- name: Run legislation_votes_generator.py
run: python scripts/legislation_votes_generator.py
- name: Commit and push if changes
run: |
# Set up Git to use the GITHUB_TOKEN for authentication
git config --local user.email "[email protected]"
git config --local user.name "bot"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
# Git commands to add, commit, and push
git pull
git add 'public/assembly.geo.json' 'public/senate.geo.json' 'public/legislations_votes.json'
git commit -m "Update legislative support jsons" || echo "No changes to commit"
git push