Add formatting and linting to pre-commit
This commit is contained in:
@@ -3,14 +3,13 @@ name: Build and Test
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- '**.md'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release/**
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
|
||||
- '**.md'
|
||||
|
||||
env:
|
||||
# Variables defined in the repository
|
||||
@@ -52,7 +51,7 @@ jobs:
|
||||
echo "[email protected]" >> $GITHUB_ENV;
|
||||
|
||||
git add action.yml
|
||||
SKIP=set-docker-tag-from-branch git commit -m "chore: Set docker tag for master [skip-ci]"
|
||||
SKIP=lint,format,set-docker-tag-from-branch git commit -m "chore: Set docker tag for master [skip-ci]"
|
||||
git push
|
||||
fi
|
||||
else
|
||||
@@ -125,7 +124,7 @@ jobs:
|
||||
needs: docker-build
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Test current action
|
||||
steps:
|
||||
@@ -164,7 +163,7 @@ jobs:
|
||||
needs: docker-build
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Mock a release
|
||||
steps:
|
||||
@@ -183,7 +182,7 @@ jobs:
|
||||
needs: docker-build
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Mock a release in a different working directory
|
||||
steps:
|
||||
|
||||
+14
-7
@@ -1,16 +1,23 @@
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- repo: local
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: set-docker-tag-from-branch
|
||||
- id: format
|
||||
name: Format
|
||||
entry: yarn format
|
||||
language: system
|
||||
- id: lint
|
||||
name: Lint
|
||||
entry: yarn lint
|
||||
language: system
|
||||
- id: set-docker-tag-from-branch
|
||||
name: Set docker tag in action.yml from current git branch
|
||||
entry: yarn set-docker-tag-from-branch
|
||||
language: system
|
||||
pass_filenames: false
|
||||
|
||||
Reference in New Issue
Block a user