Bump Dependencies #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| 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 | |
| - 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 |