Improve crates.io new crate error message (#19523)

This commit is contained in:
Zanie Blue
2026-05-21 13:25:20 -07:00
committed by GitHub
parent 51ba989e67
commit 4ffb506acf
+9
View File
@@ -309,11 +309,20 @@ def main() -> None:
token = os.environ.get("CARGO_REGISTRY_TOKEN", "")
if not token:
crate_names = ", ".join(crate["name"] for crate in candidates)
print(
f"Crates requiring crates.io publish setup: {crate_names}",
file=sys.stderr,
)
print(
"error: CARGO_REGISTRY_TOKEN is required (with `publish-new`"
" and `trusted-publishing` scopes)",
file=sys.stderr,
)
print(
"\nPlease reach out to Zanie about releases which add a new crate.",
file=sys.stderr,
)
sys.exit(1)
client = httpx.Client(headers={"User-Agent": USER_AGENT}, timeout=30)