Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

98 lignes
2.5 KiB

  1. name: Linters
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. permissions:
  6. contents: read
  7. concurrency:
  8. group: commitcheck-xhiveframework-${{ github.event_name }}-${{ github.event.number }}
  9. cancel-in-progress: true
  10. jobs:
  11. commit-lint:
  12. name: 'Semantic Commits'
  13. runs-on: ubuntu-latest
  14. if: github.event_name == 'pull_request'
  15. steps:
  16. - uses: actions/checkout@v4
  17. with:
  18. fetch-depth: 200
  19. - uses: actions/setup-node@v3
  20. with:
  21. node-version: 18
  22. check-latest: true
  23. - name: Check commit titles
  24. run: |
  25. npm install @commitlint/cli @commitlint/config-conventional
  26. npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
  27. docs-required:
  28. name: 'Documentation Required'
  29. runs-on: ubuntu-latest
  30. if: github.event_name == 'pull_request'
  31. steps:
  32. - name: 'Setup Environment'
  33. uses: actions/setup-python@v4
  34. with:
  35. python-version: '3.10'
  36. - uses: actions/checkout@v4
  37. - name: Validate Docs
  38. env:
  39. PR_NUMBER: ${{ github.event.number }}
  40. run: |
  41. pip install requests --quiet
  42. python $GITHUB_WORKSPACE/.github/helper/documentation.py $PR_NUMBER
  43. linter:
  44. name: 'Semgrep Rules'
  45. runs-on: ubuntu-latest
  46. if: github.event_name == 'pull_request'
  47. steps:
  48. - uses: actions/checkout@v4
  49. - uses: actions/setup-python@v4
  50. with:
  51. python-version: '3.10'
  52. cache: pip
  53. - name: Download Semgrep rules
  54. run: git clone --depth 1 https://lab.membtech.com/xhiveframework/semgrep-rules.git xhiveframework-semgrep-rules
  55. - name: Run Semgrep rules
  56. run: |
  57. pip install semgrep
  58. semgrep ci --config ./xhiveframework-semgrep-rules/rules --config r/python.lang.correctness
  59. deps-vulnerable-check:
  60. name: 'Vulnerable Dependency Check'
  61. runs-on: ubuntu-latest
  62. steps:
  63. - uses: actions/setup-python@v4
  64. with:
  65. python-version: '3.10'
  66. - uses: actions/checkout@v4
  67. - name: Cache pip
  68. uses: actions/cache@v3
  69. with:
  70. path: ~/.cache/pip
  71. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
  72. restore-keys: |
  73. ${{ runner.os }}-pip-
  74. ${{ runner.os }}-
  75. - name: Install and run pip-audit
  76. run: |
  77. pip install pip-audit
  78. cd ${GITHUB_WORKSPACE}
  79. pip-audit --desc on --ignore-vuln GHSA-4xqq-73wg-5mjp .