common-pr-checks.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: PR Common Checks
  2. on:
  3. pull_request:
  4. types: [opened, edited, synchronize, reopened]
  5. jobs:
  6. common-checks:
  7. name: PR Common Checks
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. with:
  12. fetch-depth: 1
  13. - name: Config Git User
  14. run: |
  15. git config --local user.name "tecvan"
  16. git config --local user.email "fanwenjie.fe@bytedance.com"
  17. - uses: actions/setup-node@v3
  18. with:
  19. node-version: 18
  20. - name: Install Dependencies
  21. run: node common/scripts/install-run-rush.js install
  22. # PR Title Format Check
  23. - name: Check PR Title Format
  24. if: ${{ !contains(github.event.pull_request.title, 'WIP') && !contains(github.event.pull_request.title, 'wip') }}
  25. env:
  26. PR_TITLE: ${{ github.event.pull_request.title }}
  27. run: |
  28. node common/scripts/install-run-rush.js update-autoinstaller --name rush-commitlint && \
  29. pushd common/autoinstallers/rush-commitlint && \
  30. echo "$PR_TITLE" | npx commitlint --config commitlint.config.js && \
  31. popd
  32. # Add more common checks here
  33. # For example: file size checks, specific file format validations, etc.