fate-test-command.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: fate-test-command
  2. on:
  3. repository_dispatch:
  4. types: [fate-test-command]
  5. jobs:
  6. fate-test-command:
  7. runs-on: ubuntu-latest
  8. name: A job to exec fate test
  9. steps:
  10. - name: Create comment
  11. uses: peter-evans/create-or-update-comment@v1
  12. id: create-comment
  13. with:
  14. issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
  15. body: |
  16. ## fate-test
  17. [![](https://img.shields.io/static/v1?style=flat-square&logo=github&label=action&message=fate-test&color=orange)](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) [![](https://img.shields.io/static/v1?style=flat-square&logo=github&label=type-${{ github.event.client_payload.slash_command.args.named.type }}&message=name-${{ github.event.client_payload.slash_command.args.named.name }}&color=orange)](${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.client_payload.pull_request.number }}#issuecomment-${{ github.event.client_payload.github.payload.comment.id }})
  18. - name: Checkout
  19. uses: actions/checkout@v2
  20. with:
  21. token: ${{ secrets.GITHUB_TOKEN }}
  22. repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
  23. ref: ${{ github.event.client_payload.pull_request.head.ref }}
  24. submodules: true
  25. - name: fate test
  26. id: fate-test
  27. uses: weiwee/fate-test-action@v1
  28. with:
  29. type: ${{ github.event.client_payload.slash_command.args.named.type }}
  30. name: ${{ github.event.client_payload.slash_command.args.named.name }}
  31. - name: Create or update comment
  32. uses: peter-evans/create-or-update-comment@v1
  33. with:
  34. issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
  35. comment-id: ${{ steps.create-comment.outputs.comment-id }}
  36. edit-mode: append
  37. body: |
  38. ### results
  39. ```
  40. ${{ steps.fate-test.outputs.body }}
  41. ```
  42. - name: Add reaction
  43. uses: peter-evans/create-or-update-comment@v1
  44. with:
  45. repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
  46. comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
  47. reaction-type: hooray