mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Packaging: fix status badges in frozen readme
GitHub status badge urls no longer allow branch=TAG. Must use branch=BRANCH or tag=TAG. (This was only visible in published description on PyPI.) (Actions job filter still requires branch=TAG_OR_BRANCH)
This commit is contained in:
@@ -12,10 +12,16 @@ def freeze_readme_versions(text: str, version: str) -> str:
|
|||||||
(This assumes version X.Y will be tagged "vX.Y" in git.)
|
(This assumes version X.Y will be tagged "vX.Y" in git.)
|
||||||
"""
|
"""
|
||||||
release_tag = f"v{version}"
|
release_tag = f"v{version}"
|
||||||
|
# (?<=...) is "positive lookbehind": must be there, but won't get replaced
|
||||||
|
text = re.sub(
|
||||||
|
# GitHub Actions badge: badge.svg?branch=main --> badge.svg?tag=vX.Y.Z:
|
||||||
|
r"(?<=badge\.svg\?)branch=main",
|
||||||
|
f"tag={release_tag}",
|
||||||
|
text,
|
||||||
|
)
|
||||||
return re.sub(
|
return re.sub(
|
||||||
# (?<=...) is "positive lookbehind": must be there, but won't get replaced
|
# GitHub Actions status links: branch:main --> branch:vX.Y.Z:
|
||||||
# GitHub Actions build status: branch=main --> branch=vX.Y.Z:
|
r"(?<=branch:)main"
|
||||||
r"(?<=branch[=:])main"
|
|
||||||
# ReadTheDocs links: /stable --> /vX.Y.Z:
|
# ReadTheDocs links: /stable --> /vX.Y.Z:
|
||||||
r"|(?<=/)stable"
|
r"|(?<=/)stable"
|
||||||
# ReadTheDocs badge: version=stable --> version=vX.Y.Z:
|
# ReadTheDocs badge: version=stable --> version=vX.Y.Z:
|
||||||
|
|||||||
Reference in New Issue
Block a user