validations.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. - uses: danger/swift@3.3.1
  28. env:
  29. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
  30. run-danger-for-external-pr:
  31. runs-on: ubuntu-latest
  32. if: |
  33. github.event_name == 'issue_comment' && github.event.action == 'created'
  34. && github.event.issue.pull_request != null
  35. && startsWith(github.event.comment.body, '/run_checks')
  36. steps:
  37. - uses: actions/github-script@v2
  38. with:
  39. script: |
  40. github.reactions.createForIssueComment({
  41. owner: context.repo.owner,
  42. repo: context.repo.repo,
  43. comment_id: context.payload.comment.id,
  44. content: "+1"
  45. })
  46. - uses: actions/github-script@v2
  47. id: pr-details
  48. with:
  49. script: |
  50. const { data: pullRequest } = await github.pulls.get({
  51. owner: context.repo.owner,
  52. repo: context.repo.repo,
  53. pull_number: context.issue.number
  54. });
  55. return pullRequest;
  56. - uses: actions/checkout@v2
  57. with:
  58. repository: ${{fromJSON(steps.pr-details.outputs.result).head.repo.full_name}}
  59. ref: ${{fromJSON(steps.pr-details.outputs.result).head.ref}}
  60. fetch-depth: 0
  61. - uses: danger/swift@3.3.2
  62. with:
  63. args: "--pr ${{github.event.issue.pull_request.url}}"
  64. env:
  65. GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}