pull-request.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: PR Workflows
  2. # Run action on pull request event
  3. on: [pull_request]
  4. jobs:
  5. # Build exampleSite
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. # checkout to the commit that has been pushed
  10. - uses: actions/checkout@v4.1.1
  11. - name: Setup Node
  12. uses: actions/setup-node@v4
  13. with:
  14. node-version: 18
  15. - name: Install node modules
  16. run: npm install
  17. - name: Setup Hugo
  18. uses: peaceiris/actions-hugo@v2.6.0
  19. with:
  20. hugo-version: 'latest'
  21. extended: true
  22. - name: Build
  23. run: |
  24. cd exampleSite
  25. hugo --minify
  26. # Run linter
  27. lint:
  28. runs-on: ubuntu-latest
  29. steps:
  30. - uses: actions/checkout@v4.1.1
  31. - name: Setup Node
  32. uses: actions/setup-node@v4
  33. with:
  34. node-version: 18
  35. - name: Install node modules
  36. run: npm install
  37. - name: Lint
  38. run: |
  39. npm run lint
  40. # Ensure that PR has desired labels
  41. enforce-label:
  42. runs-on: ubuntu-latest
  43. steps:
  44. - uses: yogevbd/enforce-label-action@2.2.2
  45. with:
  46. REQUIRED_LABELS_ANY: "automerge,breaking-change,bug-fix,enhancement,feature,translation"
  47. REQUIRED_LABELS_ANY_DESCRIPTION: "The PR must have at least one these labels: ['automerge','breaking-change','bug-fix','enhancement','feature','translation']"
  48. # Check for any broken links
  49. markdown-link-check:
  50. runs-on: ubuntu-latest
  51. steps:
  52. # checkout to latest commit
  53. - uses: actions/checkout@v4.1.1
  54. # run markdown linter
  55. - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15