linters.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Linters
  2. permissions: read-all
  3. on:
  4. pull_request:
  5. branches:
  6. - main
  7. workflow_dispatch:
  8. jobs:
  9. jshint:
  10. name: Javascript Linter
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
  14. - name: Install linters
  15. run: |
  16. sudo npm install -g jshint@2.13.6 eslint@8.57.0
  17. - name: Run jshint
  18. run: jshint internal/ui/static/js/*.js
  19. - name: Run ESLint
  20. run: eslint internal/ui/static/js/*.js
  21. golangci:
  22. name: Golang Linters
  23. runs-on: ubuntu-latest
  24. steps:
  25. - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
  26. - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
  27. with:
  28. go-version: stable
  29. - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
  30. - name: Run gofmt linter
  31. run: gofmt -d -e .
  32. commitlint:
  33. if: github.event_name == 'pull_request'
  34. name: Commit Linter
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
  38. with:
  39. fetch-depth: 0
  40. - name: Set up Python
  41. uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
  42. with:
  43. python-version: '3.13'
  44. - name: Validate PR commits
  45. run: python3 .github/workflows/scripts/commit-checker.py --base ${{ github.event.pull_request.base.sha }} --head ${{ github.event.pull_request.head.sha }}