-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (29 loc) · 998 Bytes
/
code_quality_checks.yml
File metadata and controls
33 lines (29 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# workflow to validate code formatting using pre-commit hooks
name: Code Quality Check
permissions:
contents: read
on:
- pull_request
- workflow_dispatch
jobs:
pre-commit:
runs-on: [ self-hosted ]
container: python:3.9
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for pre-commit to work
- name: Configure git for container
run: |
git config --global --add safe.directory /__w/node-scraper/node-scraper
git config --global user.email "ci@github.com"
git config --global user.name "CI Bot"
- name: setup environment and run pre-commit hooks
shell: bash
run: |
source ./dev-setup.sh
pre-commit run --all-files --show-diff-on-failure --color=always
- name: Print message on failure
if: failure()
run: |
echo "### :x: Pre-commit hooks failed. Please check logs for changes needed" >> $GITHUB_STEP_SUMMARY