Skip to content

Commit 6b0b3fa

Browse files
committed
[BUG] Stop resolving GitPython at PSR Docker image build time
GitPython v3.1.60 dropped the `Actor.name_email_regex` class attribute that python-semantic-release v10.6.1 (latest release) still reads unconditionally, breaking config load for every user of the official Docker action: type object 'Actor' has no attribute 'name_email_regex' The action's requirements.txt only pins python-semantic-release, not GitPython, so the image resolves the newest GitPython at build time regardless of which PSR tag we pin. Every run broke simultaneously. python-semantic-release/python-semantic-release#1476 has a fix, but no release yet. Replace the Docker action step with pipx installing PSR ourselves so we can pin GitPython below the broken release, and invoke `semantic-release` directly. Revert once a fixed PSR version ships. Co-authored-by: Copilot App <[email protected]> Signed-off-by: John McCall <[email protected]>
1 parent 1be487f commit 6b0b3fa

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

‎.github/workflows/publish_packages.yml‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,43 @@ jobs:
6969
fetch-depth: 0
7070
persist-credentials: false
7171

72+
# The official Docker action resolves GitPython (an unpinned transitive
73+
# dependency) at image-build time, so every run picks up whatever
74+
# GitPython release is newest. GitPython v3.1.60 dropped the
75+
# `Actor.name_email_regex` class attribute that PSR v10.6.1 (latest as
76+
# of writing) still reads unconditionally, breaking config load for
77+
# every user of the action regardless of which PSR tag is pinned. The
78+
# fix is an open PR with no PSR release yet, so install PSR ourselves
79+
# in an isolated pipx venv where we can pin GitPython below the broken
80+
# release. Revert to the Docker action once a fixed PSR version ships.
81+
# See: https://github.com/python-semantic-release/python-semantic-release/issues/1476
82+
- name: Install python-semantic-release
83+
if: github.event_name == 'push'
84+
run: |
85+
pipx install "python-semantic-release==10.6.1"
86+
pipx inject python-semantic-release "gitpython<3.1.60"
87+
7288
# Computes the next version from the commits since this package's last
7389
# release tag, attributing each commit to the package by its changed
7490
# files (see path_filters in the package's pyproject.toml), and, if a
7591
# release is warranted, tags and pushes it (no commit, no committed
7692
# changelog — release notes go to the GitHub Release instead). PSR
77-
# authenticates its own git push with github_token, independent of the
93+
# authenticates its own git push with GH_TOKEN, independent of the
7894
# checkout step's (deliberately non-persisted) credentials. Skipped
7995
# entirely on workflow_dispatch: a manual run never tags or releases,
80-
# it only smoke-tests the build/publish steps below.
96+
# it only smoke-tests the build/publish steps below. PSR itself detects
97+
# $GITHUB_OUTPUT and writes the same `released`/`version`/`tag`/etc.
98+
# outputs the Docker action would have.
8199
- name: Release ${{ matrix.package }}
82100
id: release
83101
if: github.event_name == 'push'
84-
uses: python-semantic-release/python-semantic-release@39dd2052f2ce8282a5d932c31d58a2ca06d2550e # v10.6.1
85-
with:
86-
directory: packages/${{ matrix.package }}
87-
github_token: ${{ secrets.GITHUB_TOKEN }}
88-
git_committer_name: github-actions[bot]
89-
git_committer_email: 41898282+github-actions[bot]@users.noreply.github.com
90-
commit: false
91-
tag: true
92-
push: true
93-
changelog: false
94-
vcs_release: true
95-
build: false
102+
working-directory: packages/${{ matrix.package }}
103+
env:
104+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
run: |
106+
git config --global user.name "github-actions[bot]"
107+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
108+
semantic-release -v version --no-commit --tag --push --no-changelog --vcs-release --skip-build
96109
97110
- name: Install uv
98111
if: github.event_name == 'workflow_dispatch' || steps.release.outputs.released == 'true'

0 commit comments

Comments
 (0)