Skip to content

Commit

Permalink
Merge pull request actions#1823 from jorgectf/add-PR-checks
Browse files Browse the repository at this point in the history
Add Pull Request check
  • Loading branch information
Phantsure authored Nov 29, 2022
2 parents 105959e + ec11d35 commit d4b97ff
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
pull_request:
branches:
- main

jobs:

pre-commit:
name: pre-commit
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install pre-commit
run: pip3 install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color always
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: (automation/|ci/|code-scanning/|deployments/|pages/).*(yaml|yml|json)$

0 comments on commit d4b97ff

Please sign in to comment.