Repository navigation
Commit 0ef07ef
committed
fix(ci): replaced GitPython pin with a compat shim
Follow-up to 5107894, which unblocked the release job by pinning
GitPython below 3.1.60. The pin works, but it holds every consuming
repository's release job on GitPython 3.1.59 for as long as
python-semantic-release takes to ship #1477 -- and 3.1.59 carries two
open advisories that 3.1.60 fixes: GHSA-g5vv-9gxw-82hx (high, ReDoS in
commit author/committer parsing) and GHSA-whh4-5q6c-9v3x (medium).
GitPython therefore stays current and only the removed attribute is
restored. This is security-preferable rather than merely equivalent:
Actor._from_string no longer uses the regex, so untrusted commit data
keeps the hardened parser, and PSR applies the restored attribute solely
to the configured author string from pyproject.toml or the environment.
The shim is written to $RUNNER_TEMP and loaded through PYTHONPATH scoped
to the semantic-release invocation, so it does not reach the package
build or any other Python process in the job.
Note for anyone reproducing this from the issue: the shim published
there does not work. The attribute `git.util` resolves to git.index.util,
not git.util, so `import git.util` patches the wrong module; its bare
`except Exception: pass` then swallows the AttributeError and the shim
silently does nothing. It has to be `from git.util import Actor`.
An assertion in the install step now fails the run if the shim is ever
ineffective, so that failure mode cannot reach the release step again.
Verified against python-semantic-release 10.6.1 with GitPython 3.1.60:
the release aborts without the shim and returns a version with it, the
guard exits non-zero when the shim is bypassed, the attribute does not
leak into unrelated interpreters, and Actor._from_string remains
regex-free. actionlint 1.7.7 reports no findings; shellcheck is clean on
the changed step.
REMOVE THIS SHIM once a python-semantic-release release newer than
10.6.1 ships, containing python-semantic-release#1477.
Refs: python-semantic-release/python-semantic-release#1476
Closes #791 parent 7bb5e8d commit 0ef07ef
1 file changed
Lines changed: 42 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
334 | 367 | | |
335 | 368 | | |
336 | 369 | | |
| |||
372 | 405 | | |
373 | 406 | | |
374 | 407 | | |
375 | | - | |
| 408 | + | |
376 | 409 | | |
377 | 410 | | |
378 | 411 | | |
| |||
0 commit comments