Skip to content

Download Polis Summary Reports #11483

Download Polis Summary Reports

Download Polis Summary Reports #11483

name: Download Polis Summary Reports
on:
# Run manually via GitHub UI
workflow_dispatch:
# Run on a schedule (every 15 minutes)
schedule:
- cron: '*/15 * * * *'
# Run when changes are pushed to the repository
push:
# Add this permissions block to grant write access
permissions:
contents: write
jobs:
download-and-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create summary directory if it doesn't exist
run: mkdir -p summary
- name: Download Polis summary reports
run: |
curl https://pol.is/api/v3/reportExport/r5d5xd3mujrnkkyuyrkbv/summary.csv > 9beed8nszd-summary.csv
curl https://pol.is/api/v3/xid/997f4eb9-c8b1-4a9e-aef5-f95b07e84add-xid.csv > 9beed8nszd-xid.csv
curl https://pol.is/api/v3/reportExport/r8hyz43tdvsk6knwvufjc/summary.csv > 67rd2fmrpm-summary.csv
curl https://pol.is/api/v3/xid/cf103d7c-1dc3-470c-bbec-44a2e4fe3ba4-xid.csv > 67rd2fmrpm-xid.csv
curl https://pol.is/api/v3/reportExport/r2pcmwsems3fsk7nyxcez/summary.csv > 9my4ftmrim-summary.csv
curl https://pol.is/api/v3/xid/429415e7-335a-4f9d-8877-15e48c122b4b-xid.csv > 9my4ftmrim-xid.csv
curl https://pol.is/api/v3/reportExport/r5kstupvmupfdewraufsb/summary.csv > 2hdcecwjyc-summary.csv
curl https://pol.is/api/v3/xid/71dea399-de5d-4585-98c7-fc0f54ea94b4-xid.csv > 2hdcecwjyc-xid.csv
- name: Move files to summary folder
run: |
mv 9beed8nszd-summary.csv summary/
mv 67rd2fmrpm-summary.csv summary/
mv 9my4ftmrim-summary.csv summary/
mv 2hdcecwjyc-summary.csv summary/
mv 9beed8nszd-xid.csv xid/
mv 67rd2fmrpm-xid.csv xid/
mv 9my4ftmrim-xid.csv xid/
mv 2hdcecwjyc-xid.csv xid/
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add summary/
git add xid/
git commit -m "Update Polis summary reports" || echo "No changes to commit"
git push