commit:     4df7cf9f3c326e0b97bbd0e24d45941a61f80ed0
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 12:42:51 2023 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 13:03:20 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elogv.git/commit/?id=4df7cf9f

pre-commit: Integrate with Github Actions

Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 .github/workflows/pre-commit-run.yml | 54 ++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/.github/workflows/pre-commit-run.yml 
b/.github/workflows/pre-commit-run.yml
new file mode 100644
index 0000000..03f285b
--- /dev/null
+++ b/.github/workflows/pre-commit-run.yml
@@ -0,0 +1,54 @@
+# This file is part of elogv
+#
+# Authors (in chronological order):
+#  - Sebastian Pipping (sping) <[email protected]>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+name: Run pre-commit on all files
+
+on:
+- pull_request
+- push
+- workflow_dispatch
+
+jobs:
+  run_pre_commit:
+    name: Run pre-commit on all files
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608  # 
v4.1.0
+
+      - name: Set up Python 3.12
+        uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236  # 
v4.7.1
+        with:
+          python-version: 3.12
+
+      - name: Install pre-commit
+        run: |-
+          pip install \
+            --disable-pip-version-check \
+            --user \
+            --no-warn-script-location \
+            pre-commit
+          echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
+
+      - name: Install pre-commit hooks
+        run: |-
+          pre-commit install --install-hooks
+
+      - name: Run pre-commit on all files
+        run: |-
+          pre-commit run --all-files

Reply via email to