Package API with $CI_JOB_TOKEN 403 Forbidden

Publish a Generic Package via CI/CD returns 403

I’m trying to publish a generic package via API according to Docu: Publish a package file

Within the very same project I’m trying to publish a package via CI/CD to the Generic Package Registry.
To realize this I’m using a $CI_JOB_TOKEN, which is supposed to have write access to the same project at which the Pipeline is running (by default).

To do it like this is recommended by the Official Docu CI/CD Example and Example CI/CD Pipeline

On my side the request inside gitlab-ci.yml looks like the following pattern:

# Define beginning part of the URL
# Of course $CI_COMMIT_TAG matches
# package version regex \A(\.?[\w\+-]+\.?)+\z
# (like some can check at

# actual curl upload request
curl --fail -H "JOB-TOKEN: $CI_JOB_TOKEN" -T ./ -o /dev/null ${PACKAGE_REGISTRY_URL}/

As a result I’m getting:
curl returns 403 Forbidden

curl: (22) The requested URL returned error: 403

What I expect to see:
The file uploads/package publishes successfully like it’s supposed to be.