Skip to content

Commit 4f008ff

Browse files
fix(ci): run semantic-release from the locked environment
Upgrading the action to v10.6.1 in the previous commit was necessary but not sufficient: the release still failed with the same error, because the fault is in GitPython rather than in PSR. GitPython 3.1.60 removed Actor.name_email_regex, which PSR reads on every config load, so every PSR version breaks against it. Confirmed by bisecting: 3.1.58 and 3.1.59 have the attribute, 3.1.60 does not. Upstream is tracking it and the fix is not yet released: python-semantic-release/python-semantic-release#1476 The published action builds its own image and resolves gitpython~=3.0 at build time, so there is no way to constrain the version from here. Run semantic-release from our own locked environment instead, where the lockfile pins a working GitPython and Dependabot can bump both in step. Adds a `release` dependency group for the purpose, included in `dev` so the tool stays available locally without being declared twice. Verified end to end against the merged main: the release resolves 0.8.0 and writes released=true, version=0.8.0 and tag=v0.8.0 to GITHUB_OUTPUT, which is the contract the publish steps depend on. Those steps are left on the published action, since they do not load PSR config.
1 parent ad12bcd commit 4f008ff

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

‎.github/workflows/semantic-release.yml‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,31 @@ jobs:
2424
- run: |
2525
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
2626
27+
- uses: astral-sh/setup-uv@v5
28+
with:
29+
enable-cache: true
30+
31+
# Run semantic-release from the locked environment rather than the
32+
# published action. The action builds its own image and resolves
33+
# gitpython~=3.0 at build time, so GitPython 3.1.60 -- which removed
34+
# Actor.name_email_regex, an attribute PSR reads on every config load --
35+
# breaks it from the outside, at every PSR version. Upstream:
36+
# https://github.com/python-semantic-release/python-semantic-release/issues/1476
37+
#
38+
# Our lockfile pins a working GitPython, so this keeps releases
39+
# reproducible and lets Dependabot bump both in step. Revert to the
40+
# action once the fix ships.
2741
- name: Python Semantic Release
2842
id: release
29-
uses: python-semantic-release/[email protected]
30-
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
run: |
47+
git config --global user.name "github-actions[bot]"
48+
git config --global user.email \
49+
"41898282+github-actions[bot]@users.noreply.github.com"
50+
uv sync --frozen --no-default-groups --only-group=release
51+
uv run --no-sync semantic-release version
3252
3353
- name: Publish package to GitHub
3454
uses: python-semantic-release/[email protected]

‎pyproject.toml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ linting = [
9292
pre-commit = [
9393
"pre-commit>=4.1.0",
9494
]
95+
release = [
96+
"python-semantic-release>=10.6.1",
97+
]
9598
automation = [
9699
"nox[uv]>=2025.2.9",
97100
]
@@ -103,8 +106,8 @@ dev = [
103106
{include-group = "linting"},
104107
{include-group = "pre-commit"},
105108
{include-group = "automation"},
109+
{include-group = "release"},
106110
"ipython>=8.18.1",
107-
"python-semantic-release>=10.6.1",
108111
"pandas>=2.2.3",
109112
"ipykernel>=6.29.5",
110113
"rich>=13.9.4",

‎uv.lock‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)