fileheader.yml 934 B

12345678910111213141516171819202122232425262728293031323334353637
  1. name: File header
  2. on:
  3. pull_request:
  4. branches: [ develop ]
  5. paths:
  6. - 'CMSIS/Core/**'
  7. - 'CMSIS/Core_A/**'
  8. - 'CMSIS/RTOS2/Include/**'
  9. - 'CMSIS/RTOS2/Source/**'
  10. - 'Device/**'
  11. permissions:
  12. contents: read
  13. pull-requests: write
  14. jobs:
  15. check:
  16. name: Check file header
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Checkout repository
  20. uses: actions/checkout@v2
  21. with:
  22. ref: ${{ github.event.pull_request.head.sha }}
  23. fetch-depth: ${{ github.event.pull_request.commits }}
  24. - id: files
  25. uses: jitterbit/get-changed-files@v1
  26. - name: Check changed files
  27. run: |
  28. echo "::add-matcher::.github/fileheader.json"
  29. RC=0
  30. for changed_file in ${{ steps.files.outputs.added_modified }}; do
  31. ./CMSIS/Utilities/check_header.sh ${changed_file} || RC=1
  32. done
  33. echo "::remove-matcher owner=fileheader::"
  34. exit $RC