semantic-release "EINVALIDBRANCH" branch not configured in CI
semantic-release only releases from branches listed in its branches configuration. When it runs on a branch not in that list, it logs that the branch is not configured and exits without releasing. This is expected behavior, not a crash, but often surprising in CI.
What this error means
The log says "This test run was triggered on the branch X, while semantic-release is configured to only publish from ..." and no release happens.
[semantic-release] This test run was triggered on the branch develop, while semantic-release is
configured to only publish from main, next.
Cannot find a valid semantic-release configuration for branch develop.Common causes
The workflow triggers on a non-release branch
CI ran on develop or a feature branch that is not part of the branches list, so semantic-release correctly declines to release.
The branches config omits the intended branch
You release from master but the config lists only main, so the real branch is treated as non-release.
How to fix it
Add the branch to the branches config
- List every branch semantic-release should release from.
- Include prerelease branches (next, beta) if you use them.
- Re-run so the current branch matches a configured entry.
{
"branches": ["main", "next", { "name": "beta", "prerelease": true }]
}Restrict the workflow trigger to release branches
Only run the release job on branches you actually release from.
on:
push:
branches: [main]How to prevent it
- Keep the workflow trigger branches aligned with the branches config.
- List all release and prerelease branches explicitly.
- Use the default
mainnaming or add your real default branch name.