summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorKeewis <keewis@posteo.de>2021-05-31 17:20:52 +0200
committerKeewis <keewis@posteo.de>2021-05-31 18:29:12 +0200
commitddd352a9ea5e6f367ba754179a542fbe6d841e51 (patch)
treeb7bea86d36fbbddfb54977a4d9bf1cda428d02c2 /.github
parentcdf0a50f49c6ad55a77b312166d3803f17d3e618 (diff)
downloadpint-ddd352a9ea5e6f367ba754179a542fbe6d841e51.tar.gz
add a ci to automatically update the hook versions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/lint-autoupdate.yml46
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..bb614a2
--- /dev/null
+++ b/.github/workflows/lint-autoupdate.yml
@@ -0,0 +1,46 @@
+name: "pre-commit autoupdate"
+
+on:
+ schedule:
+ - cron: "0 0 * * 0" # every Sunday at 00:00 UTC
+ workflow_dispatch:
+
+
+jobs:
+ autoupdate:
+ name: 'pre-commit 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}'