validations.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: Validations
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. issue_comment:
  8. types: [ created ]
  9. env:
  10. LC_CTYPE: en_US.UTF-8
  11. LANG: en_US.UTF-8
  12. jobs:
  13. validate-cocoapods:
  14. runs-on: macos-latest
  15. if: github.event_name != 'issue_comment'
  16. steps:
  17. - uses: actions/checkout@v2
  18. - run: ./Scripts/ci-select-xcode.sh
  19. - run: pod lib lint
  20. run-danger-for-internal-pr:
  21. runs-on: ubuntu-latest
  22. if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
  23. steps:
  24. - uses: actions/checkout@v2
  25. with:
  26. fetch-depth: 0
  27. - name: danger/swift
  28. uses: docker://frmeloni/danger-swift-with-swiftlint:1.3.1
  29. env:
  30. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
  31. run-danger-for-external-pr:
  32. runs-on: ubuntu-latest
  33. if: |
  34. github.event_name == 'issue_comment' && github.event.action == 'created'
  35. && github.event.issue.pull_request != null
  36. && startsWith(github.event.comment.body, '/run_checks')
  37. steps:
  38. - uses: sushichop/action-repository-permission@v1
  39. with:
  40. required-permission: write
  41. reaction-permitted: '+1'
  42. comment-not-permitted: "Sorry, you don't have enough permission to execute /run_checks..."
  43. - uses: actions/github-script@v2
  44. id: pr-details
  45. with:
  46. script: |
  47. const { data: pullRequest } = await github.pulls.get({
  48. owner: context.repo.owner,
  49. repo: context.repo.repo,
  50. pull_number: context.issue.number
  51. });
  52. return pullRequest;
  53. - uses: actions/checkout@v2
  54. with:
  55. repository: ${{fromJSON(steps.pr-details.outputs.result).head.repo.full_name}}
  56. ref: ${{fromJSON(steps.pr-details.outputs.result).head.ref}}
  57. fetch-depth: 0
  58. - name: danger/swift
  59. uses: docker://frmeloni/danger-swift-with-swiftlint:1.3.1
  60. with:
  61. args: "--pr ${{github.event.issue.pull_request.url}}"
  62. env:
  63. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}