`EGITNOPERMISSION` Error When Running semantic-release on Travis CI
Current behavior
Hey semantic-release folks,
I'm trying to set up semantic-release on Travis CI for my repository, but I'm encountering an EGITNOPERMISSION error, which prevents semantic-release from pushing tags to GitHub. One thing to note this works on public repos, but not private repos for some reason.
The error message states:
Cannot push to the Git repository. semantic-release cannot push the version tag to the branch master.
I've already added a GitHub Personal Access Token (GH_TOKEN) with repo scope to my Travis CI environment variables, and I verified that it exists in the build logs. My .travis.yml includes a before_script that sets up Git authentication manually:
before_script:
- git config --global user.name ""
- git config --global user.email ""
- git remote set-url origin https://[email protected]/repo/name
- git remote -v
- git config --list
- echo "Token exists: $([[ ! -z $GH_TOKEN ]] && echo 'yes' || echo 'no')"I also confirmed that my .releaserc.json file has the correct repository URL, I manually tested pushing to GitHub with the following command inside my Travis CI job:
git push https://$GH_TOKEN@github.com/repo/nameI've also use --dry-run via:
git push --dry-run https://{$GH_TOKEN}@github.com/repo/name HEAD:masterThe results are:
Everything is up to date.I also run:
git push --dry-run https://{$GH_TOKEN}@github.com/repo/name.git HEAD:masterAdding the .git to the repo name and I get:
Everything is up to date.I've also tried deleting and regenerating the GitHub token, ensuring that it's correctly added to Travis CI, but the issue persists.
Additionally, I'm seeing warnings about marked-mangle and marked-gfm-heading-id, even after installing them in the install section of my .travis.yml.
Any help would be greatly appreciated, I'm stuck here a little. First time in a while!
Expected behavior
Travis CI releases using semantic-release.
semantic-release version
21.0.2
CI environment
Travis CI
Plugins used
No response
semantic-release configuration
Private repo.
CI logs
SemanticReleaseError: Cannot push to the Git repository.
at default (file:///home/travis/build/Montana/semantic-release/node_modules/semantic-release/lib/get-error.js:6:10)
at run (file:///home/travis/build/Montana/semantic-release/node_modules/semantic-release/index.js:101:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.default (file:///home/travis/build/Montana/semantic-release/node_modules/semantic-release/index.js:275:22)
at async default (file:///home/travis/build/Montana/semantic-release/node_modules/semantic-release/cli.js:55:5) {
code: 'EGITNOPERMISSION',Source: semantic-release/semantic-release