Skip to content

Commit fdb2f8c

Browse files
Re-add update PR
1 parent 33b2fd3 commit fdb2f8c

4 files changed

Lines changed: 91 additions & 7 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Update dependencies
2+
3+
on:
4+
schedule:
5+
# Run every 15 minutes
6+
- cron: '*/15 * * * *'
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
update-dependencies:
11+
name: File update PR
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
# Checkout main branch
22+
with:
23+
ref: main
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_BOT_TOKEN }}
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v3
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.13"
34+
35+
- name: Update dependencies
36+
id: update
37+
run: |
38+
# Run the update command
39+
make update
40+
41+
# Check if there are changes
42+
if [[ -z $(git status --porcelain) ]]; then
43+
echo "No changes detected"
44+
echo "changes_detected=false" >> $GITHUB_OUTPUT
45+
else
46+
echo "Changes detected"
47+
echo "changes_detected=true" >> $GITHUB_OUTPUT
48+
fi
49+
50+
- name: Create pull request
51+
if: steps.update.outputs.changes_detected == 'true'
52+
run: |
53+
git config --global user.name "policyengine-auto"
54+
git config --global user.email "policyengine-auto@users.noreply.github.com"
55+
56+
git checkout -b update-dependencies
57+
git add .
58+
git commit -m "Update dependencies"
59+
git push origin update-dependencies --force
60+
61+
# Try to create PR, ignore if it already exists
62+
gh pr create \
63+
--title "Update dependencies" \
64+
--body "Automated dependency updates
65+
66+
This PR was automatically created by the dependency update workflow.
67+
68+
Last updated: $(date)" \
69+
--base main \
70+
--head update-dependencies || echo "PR may already exist, continuing..."
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.POLICYENGINE_BOT_TOKEN }}

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,18 @@ terraform-destroy:
299299
cd deployment/terraform/project && terraform destroy -auto-approve
300300
@echo "✅ All terraform resources destroyed"
301301

302+
# Update dependencies
303+
update:
304+
@echo "Updating dependencies for all packages..."
305+
@for pyproject in libs/*/pyproject.toml projects/*/pyproject.toml; do \
306+
if [ -f "$$pyproject" ]; then \
307+
dir=$$(dirname "$$pyproject"); \
308+
echo "Updating $$dir..."; \
309+
(cd "$$dir" && uv lock --upgrade); \
310+
fi \
311+
done
312+
@echo "✅ All dependencies updated"
313+
302314
# Code quality
303315
format:
304316
@echo "Formatting code with ruff..."

projects/policyengine-api-simulation/uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/policyengine-apis-integ/uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)