diff options
author | Jules Chéron <43635101+jules-ch@users.noreply.github.com> | 2021-07-12 23:21:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 23:21:43 +0200 |
commit | 3a428c2814966af7971f87412d5df47bb307f8d0 (patch) | |
tree | 828981627f3c1e1c549a27e1ccab1db9fc45bc4a /.github | |
parent | 54310342c6496a41248bf64b91210f20996b7d24 (diff) | |
parent | fe3636e5b371320e029a15890aa404e446888ccf (diff) | |
download | pint-3a428c2814966af7971f87412d5df47bb307f8d0.tar.gz |
Merge pull request #1324 from keewis/pre-commit_autoupdate
add a CI to automatically update the `pre-commit` hook versions
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/lint-autoupdate.yml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/lint-autoupdate.yml b/.github/workflows/lint-autoupdate.yml new file mode 100644 index 0000000..3bf4a21 --- /dev/null +++ b/.github/workflows/lint-autoupdate.yml @@ -0,0 +1,46 @@ +name: pre-commit + +on: + schedule: + - cron: "0 0 * * 0" # every Sunday at 00:00 UTC + workflow_dispatch: + + +jobs: + autoupdate: + name: autoupdate + runs-on: ubuntu-latest + if: github.repository == 'hgrecco/pint' + steps: + - name: checkout + uses: actions/checkout@v2 + - name: Cache pip and pre-commit + uses: actions/cache@v2 + with: + path: | + ~/.cache/pre-commit + ~/.cache/pip + key: ${{ runner.os }}-pre-commit-autoupdate + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.x + - name: upgrade pip + run: python -m pip install --upgrade pip + - name: install dependencies + run: python -m pip install --upgrade pre-commit + - name: version info + run: python -m pip list + - name: autoupdate + uses: technote-space/create-pr-action@bfd4392c80dbeb54e0bacbcf4750540aecae6ed4 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EXECUTE_COMMANDS: | + python -m pre_commit autoupdate + python -m pre_commit run --all-files + COMMIT_MESSAGE: 'pre-commit: autoupdate hook versions' + COMMIT_NAME: 'github-actions[bot]' + COMMIT_EMAIL: 'github-actions[bot]@users.noreply.github.com' + PR_TITLE: 'pre-commit: autoupdate hook versions' + PR_BRANCH_PREFIX: 'pre-commit/' + PR_BRANCH_NAME: 'autoupdate-${PR_ID}' |