glab release fails with 422 when using --publish-to-catalog

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: v1.63.0
  • Operating system and version: linux
  • Gitlab.com (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

I am attempting to create a new release when a commit is merged to the main branch and, to publish the released component to the CI/CD catalog. I would like to pass a custom changelog, created with git-cliff.

glab should create a tag using the current commit as reference, a release using that tag (and the changelog I provide) and then, publish the component to the CI/CD catalog. It succeeds in doing so but, the command fails.

Steps to reproduce

> git-cliff --bump --unreleased # this shows the changelog
> NEXT_VERSION=$(git cliff --bumped-version)
> git-cliff --bump --unreleased | glab release create "${NEXT_VERSION}" --publish-to-catalog -F-
(...)
x failed to publish the release to the GitLab CI/CD catalog. error=POST https://gitlab.com/api/v4/projects/wallbox%2Fplatform%2Fcicd-components%2Fterraform/catalog/publish: 422 {message: Release has already been published}

What is the current bug behavior?

glab release fails with error code 422. The command succeeds in creating the release and, in publishing it to the catalog but, I have to ignore the error code if I want the job to succeed.

It seems like --publish-to-catalog is trying to create a new release, even if glab release has already created it.

What is the expected correct behavior?

That glab creates the release, creating the tag that I provided and with the changelog that I provided, then publishes the release to the catalog.

Relevant logs and/or screenshots

> git-cliff --bump --unreleased # this shows the changelog
> NEXT_VERSION=$(git cliff --bumped-version)
> git-cliff --bump --unreleased | glab release create "${NEXT_VERSION}" --publish-to-catalog -F-
Creating release for version: 0.1.0
Corresponding to version **0.1.0**.
### 🚀 Features
- New release pipeline
### 🐛 Bug Fixes
- Error in component
<!-- generated automatically by git-cliff from the list of conventional-commits -->
• Validating tag 0.1.0
• Tag does not exist.
• No ref provided. Creating the tag from the latest state of the default branch.
• using default branch "main" as ref
• Creating or updating release repo=wallbox/platform/cicd-components/terraform tag=0.1.0
✓ Release created:	url=https://gitlab.com/wallbox/platform/cicd-components/terraform/-/releases/0.1.0
✓ Release succeeded after 1.93 seconds.
• Publishing release tag=0.1.0 to the GitLab CI/CD catalog for repo=wallbox/platform/cicd-components/terraform...
x failed to publish the release to the GitLab CI/CD catalog. error=POST https://gitlab.com/api/v4/projects/wallbox%2Fplatform%2Fcicd-components%2Fterraform/catalog/publish: 422 {message: Release has already been published}