-
Notifications
You must be signed in to change notification settings - Fork 14
101 lines (86 loc) · 3.09 KB
/
bump.yml
File metadata and controls
101 lines (86 loc) · 3.09 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Bump Dependencies
on:
schedule:
# Run weekly on Monday at 9:00 AM UTC
- cron: '0 9 * * 1'
workflow_dispatch: # Allow manual triggering
jobs:
bump-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Check for outdated packages
id: check-outdated
run: |
poetry show --outdated > outdated.txt || true
if [ -s outdated.txt ]; then
echo "has_updates=true" >> $GITHUB_OUTPUT
echo "Outdated packages found:"
cat outdated.txt
echo "outdated<<EOF" >> $GITHUB_OUTPUT
cat outdated.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "has_updates=false" >> $GITHUB_OUTPUT
echo "No outdated packages found"
fi
- name: Update dependencies
if: steps.check-outdated.outputs.has_updates == 'true'
run: |
poetry update
poetry install
- name: Run linting
if: steps.check-outdated.outputs.has_updates == 'true'
run: |
poetry run flake8
- name: Run tests
if: steps.check-outdated.outputs.has_updates == 'true'
run: |
poetry run pytest -v
- name: Check for changes
if: steps.check-outdated.outputs.has_updates == 'true'
id: check-changes
run: |
if git diff --quiet poetry.lock pyproject.toml; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
# Remove the temporary file so it is not included in the PR
rm outdated.txt
- name: Create Pull Request
if: steps.check-outdated.outputs.has_updates == 'true' && steps.check-changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'LITE-33140: Bulk bump modules'
branch: LITE-33140-bulk-bump-modules
delete-branch: true
title: 'LITE-33140: Bulk bump modules'
body: |
## Automated Dependency Update
This PR was automatically generated by the bump workflow.
### Changes
- Updated outdated dependencies to their latest compatible versions
- All tests passed successfully
### Outdated Packages
```
${{ steps.check-outdated.outputs.outdated }}
```
Please review the changes and merge if everything looks good.
labels: |
dependencies
automated
reviewers: ${{ vars.PR_REVIEWERS }}