1
0

rsi-diff.yml 2.2 KB

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