check for mypy updates #1089
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: check for mypy updates | |
on: {workflow_dispatch, schedule: [cron: '0 0 * * *']} | |
jobs: | |
check-for-updates: | |
runs-on: ubuntu-20.04 | |
name: check for mypy updates | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
architecture: x64 | |
- id: version | |
name: check version | |
run: | | |
pip install -U mypy | |
pip freeze | grep 'mypy==' >requirements.txt | |
version="$(sed -E 's#mypy==(.*)#\1#g' ./requirements.txt)" | |
echo "version=$version" >>$GITHUB_OUTPUT | |
echo "message=automatic mypy update [$version]" >>$GITHUB_OUTPUT | |
- uses: peter-evans/create-pull-request@v3.10.0 | |
id: new_pull_request | |
with: | |
delete-branch: true | |
title: ${{ steps.version.outputs.message }} | |
commit-message: ${{ steps.version.outputs.message }} | |
branch: automatic-mypy-update | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- if: steps.new_pull_request.outputs.pull-request-url != '' | |
run: gh pr merge --auto --squash ${{ steps.new_pull_request.outputs.pull-request-url }} |