Skip to content

fix(release): vendor python-semantic-release's docker action to pin gitpython - #351

Merged
shawnoster merged 1 commit into
mainfrom
fix/pin-gitpython-in-release-action
Aug 26, 2026
Merged

shawnoster merged 1 commit into
mainfrom
fix/pin-gitpython-in-release-action

Conversation

@shawnoster

@shawnoster shawnoster commented Aug 26, 2026 •

Copy link
Copy Markdown
Owner

What and why

release.yml's "Run semantic release" step started failing on every push to main with type object 'Actor' has no attribute 'name_email_regex'. GitPython 3.1.60 (released 2026-08-25) dropped that attribute, python-semantic-release reads it unconditionally on every config load, and PSR's own dependency pin (gitpython ~= 3.0) is loose enough to resolve to it. Since the official action's Docker image is rebuilt from PyPI at job start regardless of which action SHA release.yml pins, this recurs on every push until upstream ships a fix — see python-semantic-release/python-semantic-release#1476, fix already open as #1477.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / tech debt
  • Docs / config only

Related

none — upstream tracked at python-semantic-release/python-semantic-release#1476, #1477

Evidence

  • Verified against the real thing: built the vendored image locally (docker build .github/actions/semantic-release-pinned) and confirmed pip install resolves gitpython-3.1.59, not 3.1.60.
  • Verified against the real thing: ran semantic-release version --no-commit --no-tag --no-push --no-changelog --no-vcs-release --skip-build inside that image against this repo's checkout — config loads and it correctly reports the feature branch isn't a release branch, no Actor crash.
  • make check passes locally — lint, type-check, 1174 passed, 1 skipped.

Risk and scope

  • Behaviour change: none to release semantics — same PSR version (10.6.1), same inputs/outputs, same action.sh. Only the Docker image's gitpython version is pinned down to the last-good release.
  • Deliberately out of scope: not replacing the Docker-action architecture with an in-job uv run semantic-release — that would also drop the build_command's existing Docker-image constraints (no uv, Python 3.14, documented in pyproject.toml) and touch more than this fix needs.
  • Checked and found clean: the vendored Dockerfile/action.sh/action.yml are byte-for-byte copies of upstream at the pinned SHA (39dd2052, v10.6.1) except the one added line in requirements.txt and the image: path in action.yml.

Checklist

  • Conventional Commit title — see commit conventions
  • make check passes locally — lint, type-check, tests
  • Tests cover the specific failure this fixes, not only the happy path — no test harness exercises the GitHub Actions Docker build; verified manually instead (see Evidence)
  • Behaviour changes named above, including ones the API hides
  • A BREAKING CHANGE: footer, if any, survives into the squash message — n/a, not a breaking change
  • No narration of this PR's bug left in code comments or docstrings
  • No secrets, credentials, or personal data

…itpython

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The vendored action.sh introduces (and now embeds) a few concrete correctness/security issues (invalid prompt printing, malformed error string, non-failing invalid input, and logging/handling of signing key material) that should be addressed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR restores the release workflow by vendoring python-semantic-release’s Docker-based GitHub Action and pinning gitpython to a last-known-good version, avoiding the upstream image rebuild pulling a breaking GitPython release at job runtime.

Changes:

  • Switch .github/workflows/release.yml to use a local, vendored semantic-release action.
  • Add a vendored Docker action under .github/actions/semantic-release-pinned/ with a pinned gitpython==3.1.59.
  • Document the rationale and intended revert path once upstream releases a fix.
File summaries
File Description
.github/workflows/release.yml Points the release job at the vendored semantic-release action and documents why.
.github/actions/semantic-release-pinned/requirements.txt Pins python-semantic-release and GitPython to avoid the breaking GitPython release.
.github/actions/semantic-release-pinned/Dockerfile Builds the action image from the pinned requirements.
.github/actions/semantic-release-pinned/action.yml Defines the vendored Docker action and uses the local Dockerfile.
.github/actions/semantic-release-pinned/action.sh Action entrypoint script (vendored) that executes semantic-release inside the container.
.github/actions/semantic-release-pinned/.dockerignore Minimizes Docker build context to only needed files.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants