generated from nicebots-xyz/botkit
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.42 KB
/
update_dependencies.yaml
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
name: Update Dependencies
on:
schedule:
- cron: '0 0 * * 0' # Runs at 00:00 every Sunday
workflow_dispatch: # Allows manual triggering
jobs:
update-dependencies:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
cache: true
- name: Lock dependencies
run: pdm lock
- name: Export requirements
run: pdm run export
- name: Check for changes
id: git-check
run: |
git diff --exit-code --quiet requirements.txt || echo "changed=true" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.git-check.outputs.changed == 'true'
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout -b update-dependencies-${{ github.run_id }}
git add requirements.txt pyproject.toml pdm.lock
git commit -m "Update dependencies"
git push origin update-dependencies-${{ github.run_id }}
gh pr create --title "Update dependencies" --body "This PR updates the project dependencies. Please review the changes and merge if everything looks good." --base ${{ github.ref_name }} --head update-dependencies-${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}