'Github Action step failed to push some refs to main branch

I'm trying to create a workflow that will create a tag, generate a changelog and push it to the main branch.
For some reason that I haven't understood yet, I cannot push the changelog after the tag was created, I've tried it both with a new workflow and also as an additional step.
If the step Bump Version is removed from the workflow, everything is working.

Here's my action file:

name: CI
on:
  push:
    branches:
      - main
      
permissions:
  contents: write
jobs:
  release:
    runs-on: [ self-hosted ]
    permissions:
      contents: write    
    steps:
      - uses: actions/checkout@v2
      - name: Bump version
        id: tag_version
        uses: mathieudutour/[email protected]
        with:
          github_token: ${{ secrets.PUSH_TOKEN }}
          default_bump: minor
                    
      - name: "✏️ Generate release changelog"
        uses: heinrichreimer/[email protected]
        with:
          token: ${{ secrets.PUSH_TOKEN }}
          output: CHANGELOG.md
          headerLabel: "# 📑 Changelog"
          breakingLabel: '### 💥 Breaking'
          enhancementLabel: '### 🚀 Enhancements'
          bugsLabel: '### 🐛 Bug fixes'
          stripGeneratorNotice: true
          issues: false
          issuesWoLabels: false
          pullRequests: true
          prWoLabels: true
          author: true
          verbose: true
          sinceTag: v2.25.0
      - name: Commit CHANGELOG Changes
        run: |
          git config user.name "GitHub Actions"
          git config user.email [email protected]
          git add CHANGELOG.md
          git commit -m 'Update Changelog.'
          git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}          
          git push
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The error that I'm getting here:
error: src refspec refs/heads/main matches more than one



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source