Add pr lint action

This commit is contained in:
Oleg Lobanov 2024-04-24 22:45:06 +02:00
parent 0e0b0c8095
commit 57a1010c93
No known key found for this signature in database
3 changed files with 21 additions and 11 deletions

View File

@ -26,16 +26,6 @@ jobs:
with: with:
go-version: 1.22.1 go-version: 1.22.1
- run: make lint-backend - run: make lint-backend
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-commits
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [lint-frontend, lint-backend, lint-commits] needs: [lint-frontend, lint-backend, lint-commits]

20
.github/workflows/pr-lint.yaml vendored Normal file
View File

@ -0,0 +1,20 @@
name: "Lint PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: read
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -27,7 +27,7 @@ test-backend: ## Run backend tests
$Q $(go) test -v ./... $Q $(go) test -v ./...
.PHONY: lint .PHONY: lint
lint: lint-frontend lint-backend lint-commits ## Run all linters lint: lint-frontend lint-backend ## Run all linters
.PHONY: lint-frontend .PHONY: lint-frontend
lint-frontend: ## Run frontend linters lint-frontend: ## Run frontend linters