Skip to content

Weekly US Household API Update #13

Weekly US Household API Update

Weekly US Household API Update #13

name: Weekly US Household API Update
on:
schedule:
# Every Wednesday at 5 PM EST (10 PM UTC)
- cron: "0 22 * * 3"
# Allow manual trigger
workflow_dispatch:
jobs:
update-packages:
name: Update PolicyEngine Packages
runs-on: ubuntu-latest
if: github.repository == 'PolicyEngine/policyengine-household-api'
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.POLICYENGINE_GITHUB }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install requests pyyaml
- name: Check for updates and generate summary
id: check_updates
run: python .github/scripts/check_updates.py
- name: No updates available
if: steps.check_updates.outputs.has_updates != 'true'
run: |
echo "::notice::No package updates available. policyengine_us is already at the latest version."
- name: Commit and push changes
if: steps.check_updates.outputs.has_updates == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b bot/weekly-us-update
git add setup.py changelog_entry.yaml
git commit -m "Update policyengine-us (${{ steps.check_updates.outputs.updates_summary }})"
git push -f origin bot/weekly-us-update
- name: Create Pull Request
if: steps.check_updates.outputs.has_updates == 'true'
env:
GH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}
run: .github/scripts/create_pr.sh