Refuse a release whose tag sits elsewhere, pin a typed nullable column and a relative reference in the reads test, and narrow the pin's claim to template formats
Tests / vet + fmt + tests (pull_request) Successful in 1m7s
Tests / Gitea release from CHANGELOG.md (pull_request) Has been skipped
Tests / vet + fmt + tests (push) Successful in 2m3s
Tests / Gitea release from CHANGELOG.md (push) Successful in 3s

This commit was merged in pull request #17.
This commit is contained in:
2026-09-16 20:17:50 +02:00
parent 1cf8ed502a
commit 16f2e96fe8
3 changed files with 18 additions and 13 deletions
+11 -2
View File
@@ -12,7 +12,7 @@ import sys
import urllib.error
import urllib.request
HEADING = re.compile(r"^## \[([^\]]+)\].*?$\n(.*?)(?=^## \[|\Z)", re.M | re.S)
HEADING = re.compile(r"^## \[([^\]]+)\].*?$\n?(.*?)(?=^## \[|\Z)", re.M | re.S)
def request(path: str, data: dict | None = None):
@@ -45,7 +45,16 @@ def main() -> int:
except urllib.error.HTTPError as e:
if e.code != 404:
raise
release = request("releases", {"body": body, "name": tag, "tag_name": tag, "target_commitish": os.environ["SHA"]})
sha = os.environ["SHA"]
try:
at = request(f"tags/{tag}")["commit"]["sha"]
if at != sha:
print(f"{tag} exists at {at}, not {sha}; the version is burnt, bump the heading", file=sys.stderr)
return 1
except urllib.error.HTTPError as e:
if e.code != 404:
raise
release = request("releases", {"body": body, "name": tag, "tag_name": tag, "target_commitish": sha})
print(release["html_url"])
return 0