Update Dependencies #74
This file contains 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: Update Dependencies | |
on: | |
schedule: | |
# Every Monday at 1 AM | |
- cron: '0 1 * * 1' | |
jobs: | |
Update_Deps: | |
runs-on: ubuntu-latest | |
name: ${{ matrix.name || matrix.args }} | |
strategy: | |
fail-fast: false | |
matrix: | |
args: [docs, black, flake8, isort, mypy, pylint] | |
# Uncomment to enable base dependency checking | |
# include: | |
# - args: '-b' | |
# name: Base Dependencies | |
env: | |
DEPS_UPDATED: false | |
PR_BRANCH: bumpdeps/${{ join(matrix.args, '_') }}_${{ github.run_id }} | |
PR_MSG: "BumpDeps: ${{ matrix.name || matrix.args }}" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.PR_DEPLOY_PRIVATE_KEY }} | |
- name: Install latest Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install bumpdeps | |
run: pip install bumpdeps | |
- name: Setup Git | |
run: | | |
set -x | |
git config --global user.name "BumpDeps" | |
git config --global user.email "<>" | |
git checkout -b $PR_BRANCH | |
- name: Update deps | |
run: | | |
set -x | |
bumpdeps ${{ matrix.args }} | |
git diff --quiet || echo "DEPS_UPDATED=true" >> $GITHUB_ENV | |
- name: Create PR | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
set -x | |
git commit -a -m "$PR_MSG" | |
git --no-pager log -n 2 | |
git push -u origin $PR_BRANCH | |
gh pr create -B main -H $PR_BRANCH --title "$PR_MSG" --body "Created by Github Action" | |
if: env.DEPS_UPDATED == 'true' |