format_check.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Check File Format and License
  2. on:
  3. pull_request:
  4. branches:
  5. - master
  6. paths-ignore:
  7. - documentation/**
  8. - '**/README.md'
  9. - '**/README_zh.md'
  10. concurrency:
  11. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  12. cancel-in-progress: true
  13. jobs:
  14. scancode_job:
  15. runs-on: ubuntu-22.04
  16. name: Scan code format and license
  17. if: github.repository_owner == 'RT-Thread'
  18. steps:
  19. - uses: actions/checkout@main
  20. - name: Set up Python
  21. uses: actions/setup-python@main
  22. with:
  23. python-version: 3.8
  24. - name: Check Format and License
  25. shell: bash
  26. run: |
  27. pip install click chardet PyYaml
  28. python tools/ci/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'
  29. # Post CI status to PR comment
  30. post-ci-status:
  31. needs: scancode_job
  32. if: always() && github.event_name == 'pull_request' && github.repository_owner == 'RT-Thread'
  33. uses: ./.github/workflows/post_ci_status.yml
  34. with:
  35. workflow_name: "Check File Format and License"
  36. workflow_status: ${{ needs.scancode_job.result }}
  37. pr_number: ${{ github.event.pull_request.number }}
  38. permissions:
  39. pull-requests: write
  40. issues: write