Clean and add extra handlers
This commit is contained in:
@@ -318,6 +318,17 @@ def publish_file(path: Path, cfg: Config) -> None:
|
||||
print(f" {path.name} already published (409); skipping "
|
||||
f"(use --replace to overwrite)")
|
||||
return
|
||||
if status in (401, 403):
|
||||
raise RuntimeError(
|
||||
f"upload of {path.name} failed: HTTP {status}: "
|
||||
f"{body.strip()[:200]}\n"
|
||||
f" -> The registry rejected the credentials for owner "
|
||||
f"'{cfg.owner}'.\n"
|
||||
f" Gitea's automatic Actions token (github.token / "
|
||||
f"GITEA_TOKEN) cannot write packages.\n"
|
||||
f" Use a Personal Access Token with the 'write:package' scope "
|
||||
f"(set PACKAGE_TOKEN / --token)."
|
||||
)
|
||||
raise RuntimeError(
|
||||
f"upload of {path.name} failed: HTTP {status}: {body.strip()[:500]}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user