-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: Webhooks
-
None
-
1
For large monorepos, it would be convenient to include the list of modified files in the "Pull Request Merged" webhook event payload. Depending on the files modified, the remote CI/CD system should trigger different tasks—for example, builds of separate microservices stored in the same Git repository.
Workaround
- In the PR event payload, for example, for the PR "Merged" event, find the ID of the pull request.
- Use this pull request ID to fetch additional information using the REST API endpoints related to pull requests.
Here are two options to get data, but there may be other possibilities:- A) Use Stream raw pull request diff to get a complete "diff" of the pull request.
Then, directly parse the string returned; it represents all changes in the "unified diff" format. - B) The other option would be to use the Get pull request commits REST API endpoint to get the list of commits contained in the pull request.
Then, iterate through that list and for every commit, get the list of affected files using the solution from the third-party page How do I list all the files in a commit?.
For this to work, commits must be available locally, as a result of previously executed "git clone" or "git fetch".
- A) Use Stream raw pull request diff to get a complete "diff" of the pull request.