Sending file to remote API on delivery

I’ve an application that expose a REST API. I now want to automatically publish the API changelog on every new releases. Please note that I want the changelog of the API. Not the changelog of the application.

I thought to use this workflow:

  1. I create a folder .changelog in my repo
  2. If a MR changes something on the API the developer must to create a file in .changelog with the description of the change.
  3. During the CD I want to call a specific API (it’s a third party service) where I POST the content of the new files that have been created into .changelog

So, 2 questions

  1. Is there a way to add a check in the pipeline that check that a new file has been added in the MR if the MR has a particular label ?
  2. Can someone give me an example about calling an external API with the content of a file in the repo ?


Simone