Generate changelog in branch before creating a tag

I’ve been trying to get the auto changelog creator to work with my pipelines with much frustration. The examples are a bit sparse tbh.

I have a pipeline that runs the necessary steps for my repo. I also added a .pre stage that should create a changelog entry based on differences between the previous and current tag version. It looks something like this:

  stage: .pre
    - shell
    - export LATEST_VERSION=$(git describe --tags --abbrev=0)
    - export PACKAGE_VERSION=`poetry version | awk '{print $2}'`
    - |
      echo $LATEST_VERSION
    - |
    curl --header "PRIVATE-TOKEN: xxx" --data "version=$PACKAGE_VERSION&from=$LATEST_VERSION&to=$PACKAGE_VERSION&branch=dev" ""
    - tags
    - release

The pipeline is paused and the changelog entry is added, however, it’s not added to the tag after the pipeline continues. How can I remedy this shortcoming?