mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-19 19:31:06 -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.)
|
||||
"""
|
||||
release_tag = f"v{version}"
|
||||
return re.sub(
|
||||
# (?<=...) is "positive lookbehind": must be there, but won't get replaced
|
||||
# GitHub Actions build status: branch=main --> branch=vX.Y.Z:
|
||||
r"(?<=branch[=:])main"
|
||||
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(
|
||||
# GitHub Actions status links: branch:main --> branch:vX.Y.Z:
|
||||
r"(?<=branch:)main"
|
||||
# ReadTheDocs links: /stable --> /vX.Y.Z:
|
||||
r"|(?<=/)stable"
|
||||
# ReadTheDocs badge: version=stable --> version=vX.Y.Z:
|
||||
|
||||
Reference in New Issue
Block a user