Skip to content

fix(config): replace removed Actor.name_email_regex from GitPython - #1477

Merged
codejedi365 merged 2 commits into
python-semantic-release:masterfrom
olivialewke:fix-gitpython-3.1.60-actor-regex
Aug 28, 2026
Merged

fix(config): replace removed Actor.name_email_regex from GitPython#1477
codejedi365 merged 2 commits into
python-semantic-release:masterfrom
olivialewke:fix-gitpython-3.1.60-actor-regex

Conversation

@olivialewke

Copy link
Copy Markdown
Contributor

Fixes #1476.

What

GitPython v3.1.60 (released 2026-08-25) removed the name_email_regex class attribute from git.Actor, replacing its internal use in Actor._from_string with string partitioning. RuntimeContext.from_raw_config() reads it unconditionally, so every command that loads configuration fails with:

AttributeError: type object 'Actor' has no attribute 'name_email_regex'

Since PSR requires gitpython ~= 3.0, fresh installs — including every run of the official GitHub Action, which resolves transitive dependencies at image-build time — pick up the broken version automatically.

How

GitPython no longer exposes a public equivalent, so there is nothing to migrate to. This adds NAME_EMAIL_REGEX to semantic_release.const with the same pattern GitPython used (r"(.*) <(.*?)>") and uses it in the two places Actor.name_email_regex was referenced. Actor is still used to construct the commit author, so behaviour is unchanged — including the error message, which now interpolates .pattern to keep the same readable output.

An alternative would be to pin gitpython < 3.1.60, but that leaves users stranded on a release they may want for its security fixes.

Testing

The existing test_commit_author_configurable already reproduces the failure on GitPython 3.1.60 and passes with this change. Added direct coverage of the pattern itself so a future change to it is caught independently of GitPython.

$ pip install 'gitpython==3.1.60'
$ pytest tests/unit/semantic_release/cli/test_config.py
51 passed

ruff check reports no new findings against these files.

shawnoster added a commit to shawnoster/aya that referenced this pull request Aug 26, 2026
…itpython (#351)

GitPython 3.1.60 (2026-08-25) removed Actor.name_email_regex, which
semantic_release.cli.config reads unconditionally — every release run
now crashes on 'type object Actor has no attribute name_email_regex'.
PSR pins gitpython ~= 3.0 (unpinned patch range), and the upstream
action's Docker image is rebuilt from PyPI at job start regardless of
which action SHA release.yml pins, so this recurs on every push to
main until upstream ships python-semantic-release/python-semantic-release#1477.

Vendors the action's Dockerfile/action.sh/action.yml unchanged, adding
only a gitpython==3.1.59 pin to requirements.txt. Verified locally:
the vendored image resolves gitpython 3.1.59 and `semantic-release
version` loads config and runs cleanly.

Revert to the upstream action once #1477 ships in a release.
@sebastian-montero

Copy link
Copy Markdown

oh yeah my CI is also broken

@codejedi365

Copy link
Copy Markdown
Contributor

Thanks for submitting this. Very frustrating how someone else's change unidentified breaking change affects this project. Will try to get a new version published today.

@afuetterer

Copy link
Copy Markdown
Contributor

Thanks for submitting this. Very frustrating how someone else's change unidentified breaking change affects this project. Will try to get a new version published today.

Thank you!

@catsmanac

Copy link
Copy Markdown

Thanks for submitting this. Very frustrating how someone else's change unidentified breaking change affects this project. Will try to get a new version published today.

The build is failing on exactly what is being fixed...

@dorjanshurdhi

Copy link
Copy Markdown

I ran a test in my project targeting the forked version of @olivialewke , but I am encountering the same problem.

Run olivialewke/python-semantic-release@fix-gitpython-3.1.60-actor-regex
/usr/local/bin/docker run --name bb84a423dcf1061594106a1d7947eebc21631_96c4bb --label 1bb84a --workdir /github/workspace --rm -e " "INPUT_STRICT" -e "INPUT_VERBOSITY" -e "INPUT_PRERELEASE" -e "INPUT_PRERELEASE_TOKEN" -e "INPUT_FORCE" -e "INPUT_COMMIT" -e "INPUT_CHANGELOG" -e "INPUT_VCS_RELEASE" -e "INPUT_BUILD" -e "INPUT_BUILD_METADATA" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "GITHUB_ARTIFACTS" -e "GITHUB_ARTIFACTS_LIST" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_ID_TOKEN_REQUEST_URL" -e "ACTIONS_ID_TOKEN_REQUEST_TOKEN" -e "ACTIONS_RESULTS_URL" -e "ACTIONS_ORCHESTRATION_ID" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/codebuild/output/src2915708411/src/actions-runner/_work/_temp":"/github/runner_temp" -v "/codebuild/output/src2915708411/src/actions-runner/_work/_temp/_github_home":"/github/home" -v "/codebuild/output/src2915708411/src/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/codebuild/output/src2915708411/src/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/codebuild/output/src2915708411/src/actions-runner/_work/pdnd-airflow-dags/pdnd-airflow-dags":"/github/workspace" 1bb84a:423dcf1061594106a1d7947eebc21631
$> /opt/psr/.venv/bin/semantic-release -v version --tag --push
[10:35:05] INFO     Loading configuration from pyproject.toml         util.py:77
           WARNING  Found .git/ in higher parent directory rather  config.py:412
                    than provided in configuration.                             
           INFO     Using group 'main' options, as '(main)'        config.py:603
                    matches 'main'                                              
Error:  type object 'Actor' has no attribute 'name_email_regex'
Run semantic-release in very verbose mode (-vv) to see the full traceback.

@ramundomario

ramundomario commented Aug 28, 2026

Copy link
Copy Markdown

GitPython 3.1.61 has been released & bring back, adding a deprecation notice, the unwanted breaking change in gitpython-developers/GitPython#2221

So I guess that this should be fixed, though it would be better to still handle this since the field is deprecated & will be removed in next major release (4.x)

@catsmanac

Copy link
Copy Markdown

So I guess that this shoudl be fixed,

My PSR just finished successful again :-)

@codejedi365
codejedi365 force-pushed the fix-gitpython-3.1.60-actor-regex branch from 4ad93f1 to ed6b1cb Compare August 28, 2026 19:29
With the change in GitPython v3.1.60, they removed the regex for a
commit author string, so we must do it ourselves.

Resolves: python-semantic-release#1476
@codejedi365
codejedi365 force-pushed the fix-gitpython-3.1.60-actor-regex branch from ed6b1cb to de86e16 Compare August 28, 2026 19:46
@codejedi365
codejedi365 merged commit 10afa8e into python-semantic-release:master Aug 28, 2026
9 checks passed
@codejedi365

Copy link
Copy Markdown
Contributor

🎉 This PR has been published as part of v10.6.2 🎉

You can find more information about this release on the GitHub Releases page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: GitPython v3.1.60 removed Actor.name_email_regex, breaking every config load