1
0

rsi-diff.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Diff RSIs
  2. on:
  3. pull_request_target:
  4. paths:
  5. - "**.rsi/**.png"
  6. jobs:
  7. diff:
  8. name: Diff
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v3.6.0
  13. - name: Get changed files
  14. id: files
  15. uses: Ana06/get-changed-files@v2.3.0
  16. with:
  17. format: "space-delimited"
  18. filter: |
  19. **.rsi
  20. **.png
  21. - name: Diff changed RSIs
  22. id: diff
  23. uses: space-wizards/RSIDiffBot@v1.1
  24. with:
  25. modified: ${{ steps.files.outputs.modified }}
  26. removed: ${{ steps.files.outputs.removed }}
  27. added: ${{ steps.files.outputs.added }}
  28. basename: ${{ github.event.pull_request.base.repo.full_name }}
  29. basesha: ${{ github.event.pull_request.base.sha }}
  30. headname: ${{ github.event.pull_request.head.repo.full_name }}
  31. headsha: ${{ github.event.pull_request.head.sha }}
  32. - name: Potentially find comment
  33. uses: peter-evans/find-comment@v1
  34. id: fc
  35. with:
  36. issue-number: ${{ github.event.number }}
  37. comment-author: "github-actions[bot]"
  38. body-includes: RSI Diff Bot
  39. - name: Create comment if it doesn't exist
  40. if: steps.fc.outputs.comment-id == ''
  41. uses: peter-evans/create-or-update-comment@v1
  42. with:
  43. issue-number: ${{ github.event.number }}
  44. body: |
  45. ${{ steps.diff.outputs.summary-details }}
  46. - name: Update comment if it exists
  47. if: steps.fc.outputs.comment-id != ''
  48. uses: peter-evans/create-or-update-comment@v1
  49. with:
  50. comment-id: ${{ steps.fc.outputs.comment-id }}
  51. edit-mode: replace
  52. body: |
  53. ${{ steps.diff.outputs.summary-details }}
  54. - name: Update comment to read that it has been edited
  55. if: steps.fc.outputs.comment-id != ''
  56. uses: peter-evans/create-or-update-comment@v1
  57. with:
  58. comment-id: ${{ steps.fc.outputs.comment-id }}
  59. edit-mode: append
  60. body: |
  61. Edit: diff updated after ${{ github.event.pull_request.head.sha }}