-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (55 loc) · 1.93 KB
/
Copy pathweekly-update.yaml
File metadata and controls
66 lines (55 loc) · 1.93 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repo
uses: actions/checkout@v7
with:
ref: main
token: ${{ steps.app-token.outputs.token }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v8.2.0
with:
version: "0.8.5"
- name: Install dependencies
run: |
pip install requests
- name: Check for updates and generate summary
id: check_updates
run: python .github/scripts/check_updates.py
- name: Refresh lockfile
if: steps.check_updates.outputs.has_updates == 'true'
run: uv lock --upgrade-package policyengine-us
- 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'
env:
UPDATES_SUMMARY: ${{ steps.check_updates.outputs.updates_summary }}
run: bash .github/scripts/commit-weekly-update.sh
- name: Create Pull Request
if: steps.check_updates.outputs.has_updates == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: .github/scripts/create_pr.sh