linter.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ---
  2. #################################
  3. #################################
  4. ## Super Linter GitHub Actions ##
  5. #################################
  6. #################################
  7. name: Lint Code Base
  8. #
  9. # Documentation:
  10. # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
  11. #
  12. #############################
  13. # Start the job on all push #
  14. #############################
  15. on:
  16. push:
  17. branches-ignore: [main]
  18. # Remove the line above to run when pushing to master
  19. pull_request:
  20. branches: [main]
  21. ###############
  22. # Set the Job #
  23. ###############
  24. permissions:
  25. checks: write
  26. contents: read
  27. pull-requests: write
  28. statuses: write
  29. jobs:
  30. build:
  31. # Name the Job
  32. name: Lint Code Base
  33. # Set the agent to run on
  34. runs-on: ubuntu-latest
  35. ##################
  36. # Load all steps #
  37. ##################
  38. steps:
  39. ##########################
  40. # Checkout the code base #
  41. ##########################
  42. - name: Checkout Code
  43. uses: actions/checkout@v3
  44. with:
  45. # Full git history is needed to get a proper list of changed files within `super-linter`
  46. fetch-depth: 0
  47. - name: Set-up Node.js
  48. uses: actions/setup-node@v3
  49. with:
  50. node-version: 16.x
  51. cache: yarn
  52. - name: Install dependencies
  53. run: yarn install --frozen-lockfile
  54. - name: Set-up RuboCop Problem Mathcher
  55. uses: r7kamura/rubocop-problem-matchers-action@v1
  56. - name: Set-up Stylelint Problem Matcher
  57. uses: xt0rted/stylelint-problem-matcher@v1
  58. # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
  59. - run: echo "::add-matcher::.github/stylelint-matcher.json"
  60. ################################
  61. # Run Linter against code base #
  62. ################################
  63. - name: Lint Code Base
  64. uses: github/super-linter@v4
  65. env:
  66. CSS_FILE_NAME: stylelint.config.js
  67. DEFAULT_BRANCH: main
  68. NO_COLOR: 1 # https://github.com/xt0rted/stylelint-problem-matcher/issues/360
  69. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  70. JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
  71. LINTER_RULES_PATH: .
  72. RUBY_CONFIG_FILE: .rubocop.yml
  73. VALIDATE_ALL_CODEBASE: false
  74. VALIDATE_CSS: true
  75. VALIDATE_JAVASCRIPT_ES: true
  76. VALIDATE_RUBY: true