I'm using semantic-release in a GitLab CI pipeline. The release fails at the @semantic-release/git plugin step due to this error:
remote: ERROR: New commit has non-whitelisted author email: [[email protected]](mailto:[email protected])
remote: Only emails ending with: @companydomain.com
I've set the author and committer info in all relevant places:
.releaserc.json:[ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", [ "@semantic-release/gitlab", { "gitlabUrl": "https://gitlab.example.com" } ], "@semantic-release/npm", [ "@semantic-release/git", { "gitAuthor": "bot-name <[email protected]>", "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", "assets": ["package.json", "CHANGELOG.md"] } ] ].gitlab-ci.yml:before_script: - git config --global user.name "bot-name" - git config --global user.email "[email protected]" variables: GIT_AUTHOR_NAME: 'bot-name' GIT_AUTHOR_EMAIL: '[email protected]' GIT_COMMITTER_NAME: 'bot-name' GIT_COMMITTER_EMAIL: '[email protected]'Dockerfile:ENV GIT_AUTHOR_NAME="bot-name" ENV GIT_AUTHOR_EMAIL="[email protected]" ENV GIT_COMMITTER_NAME="bot-name" ENV GIT_COMMITTER_EMAIL="[email protected]" RUN git config --global user.name "$GIT_AUTHOR_NAME" \ && git config --global user.email "$GIT_AUTHOR_EMAIL"
Despite setting these values, the release commit still uses the default [email protected], and GitLab rejects the push due to email policy.
How can I ensure semantic-release uses the correct author email when committing in GitLab CI?