mshick / add-pr-comment

uses: mshick/add-pr-comment@v2
MIT License
196 stars 54 forks source link

Support multiple `message-paths` and concatenate them. #90

Closed mshick closed 1 year ago

kishaningithub commented 1 year ago

Given https://github.com/mshick/add-pr-comment/issues/93 i feel there should be an option which creates multiple comments if multiple-paths are given. That way there can probably be a step before calling this action which splits a very big comment into multiple comments and puts them in separate files. what do you think?

mshick commented 1 year ago

@kishaningithub For #93 my preference would be to check the size of the message and break it into parts if we're going to hit the limit.

The use you describe above seems like it could be handled better by multiple instances of the action, for example:

on:
  pull_request:

jobs:
  pr:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: mshick/add-pr-comment@v2
        with:
          message-id: foo
          message-path: |
            foo/*.txt

      - uses: mshick/add-pr-comment@v2
        with:
          message-id: bar
          message-path: |
            bar/*.txt
mshick commented 1 year ago

@kishaningithub Feel free to open a new issue if you have suggestions for improvements to the concatenation feature.

kishaningithub commented 1 year ago

I never realised that message-path supports globs. Thanks a lot for that example! 👍