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
This commit was merged in pull request #17.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user