@@ -2,10 +2,15 @@ name: Update dependencies
22
33on :
44 schedule :
5- # Run every 15 minutes
6- - cron : ' */15 * * * *'
5+ # Run daily at 3:00 PM US Eastern time.
6+ - cron : ' 0 15 * * *'
7+ timezone : ' America/New_York'
78 workflow_dispatch : # Allow manual triggering
89
10+ concurrency :
11+ group : update-dependencies
12+ cancel-in-progress : false
13+
914jobs :
1015 update-dependencies :
1116 name : File update PR
2530
2631 - name : Checkout repository
2732 uses : actions/checkout@v6
28- # Checkout main branch
2933 with :
3034 ref : main
35+ fetch-depth : 0
3136 token : ${{ steps.app-token.outputs.token }}
3237
3338 - name : Install uv
@@ -37,47 +42,27 @@ jobs:
3742 uses : actions/setup-python@v6
3843 with :
3944 python-version : " 3.13"
45+
46+ - name : Prepare update branch
47+ id : branch
48+ env :
49+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
50+ run : .github/scripts/dependency-update-prepare-branch.sh
4051
4152 - name : Generate API clients
42- run : |
43- # Generate clients with correct naming before updating dependencies
44- ./scripts/generate-clients.sh
53+ run : ./scripts/generate-clients.sh
4554
4655 - name : Update dependencies
47- id : update
48- run : |
49- # Run the update command
50- make update
51-
52- # Check if there are changes
53- if [[ -z $(git status --porcelain) ]]; then
54- echo "No changes detected"
55- echo "changes_detected=false" >> $GITHUB_OUTPUT
56- else
57- echo "Changes detected"
58- echo "changes_detected=true" >> $GITHUB_OUTPUT
59- fi
60-
61- - name : Create pull request
62- if : steps.update.outputs.changes_detected == 'true'
63- run : |
64- git config --global user.name "policyengine-auto"
65- git config --global user.email "policyengine-auto@users.noreply.github.com"
66-
67- git checkout -b update-dependencies
68- git add .
69- git commit -m "Update dependencies"
70- git push origin update-dependencies --force
71-
72- # Try to create PR, ignore if it already exists
73- gh pr create \
74- --title "Update dependencies" \
75- --body "Automated dependency updates
56+ run : make update
7657
77- This PR was automatically created by the dependency update workflow.
58+ - name : Commit and push update
59+ id : push
60+ env :
61+ HAS_OPEN_PR : ${{ steps.branch.outputs.has_open_pr }}
62+ run : .github/scripts/dependency-update-commit-and-push.sh
7863
79- Last updated: $(date)" \
80- --base main \
81- --head update-dependencies || echo "PR may already exist, continuing..."
64+ - name : Create pull request
65+ if : steps.branch.outputs.has_open_pr == 'false' && steps.push.outputs.branch_pushed == 'true'
8266 env :
83- GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
67+ GH_TOKEN : ${{ steps.app-token.outputs.token }}
68+ run : .github/scripts/dependency-update-create-pr.sh
0 commit comments