fix(mirror): include link to ghcr.md in GHCR_PAT warning annotation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Environment TestandClaude Sonnet 4.6 committed 2026-04-09 11:27:18 +02:00
1 parent eb1b20be30
commit b1f2ccd471
1 file changed
+9 -2
+9 -2
View File
@@ -167,7 +167,14 @@ def main() -> int:
flush=True,
)
_GHCR_DOC = "docs/contributing/flow/security/ghcr.md"
_GHCR_DOC_PATH = "docs/contributing/flow/security/ghcr.md"
_server = os.environ.get("GITHUB_SERVER_URL", "https://github.com").rstrip("/")
_repo = os.environ.get("GITHUB_REPOSITORY", "")
_GHCR_DOC_URL = (
f"{_server}/{_repo}/blob/master/{_GHCR_DOC_PATH}"
if _repo
else _GHCR_DOC_PATH
)
try:
pkg_iter = list(_list_packages(namespace, token, account_type))
except _InsufficientTokenError as e:
@@ -175,7 +182,7 @@ def main() -> int:
f"Mirror visibility update skipped — {e}. "
"The GITHUB_TOKEN is an installation token and cannot list packages for personal accounts. "
"Set the GHCR_PAT secret to a classic PAT with read:packages and write:packages scopes. "
f"See {_GHCR_DOC} for setup instructions.",
f"See {_GHCR_DOC_URL} for setup instructions.",
title="GHCR visibility update skipped — GHCR_PAT required",
)
return 0