Reuse TOKEN_FOR_GITEA for the wiki when TOKEN_FOR_GITEA_WIKI is absent
Validate workflows / validate (pull_request) Successful in 15s

The Publish wiki workflow now reads secrets.TOKEN_FOR_GITEA_WIKI ||
secrets.TOKEN_FOR_GITEA, so the existing token can publish the wiki when it
has write:repository. Update the missing-token message, the credentials and
troubleshooting guides, the README, the tests and the affected English
wiki pages with their Danish and Bahasa Malaysia translations.

Task: MIL-005#8
This commit is contained in:
2026-10-10 09:36:47 +08:00
parent 3e18c991ce
commit 2eb852cfc6
15 changed files with 56 additions and 40 deletions
+5 -2
View File
@@ -85,7 +85,10 @@ def parse_gitea_token(raw_credentials: str | None) -> str:
"""Return the token from a bare value, a JSON string or JSON with GITEA_TOKEN."""
raw_credentials = (raw_credentials or "").strip()
if not raw_credentials:
raise WorkflowError("configuration", "TOKEN_FOR_GITEA_WIKI is missing or empty.")
raise WorkflowError(
"configuration",
"No token for the wiki: set TOKEN_FOR_GITEA_WIKI, or TOKEN_FOR_GITEA.",
)
token: Any
try:
@@ -102,7 +105,7 @@ def parse_gitea_token(raw_credentials: str | None) -> str:
if not isinstance(token, str) or not token.strip():
raise WorkflowError(
"configuration", "TOKEN_FOR_GITEA_WIKI must contain a non-empty GITEA_TOKEN."
"configuration", "The wiki token must contain a non-empty GITEA_TOKEN."
)
return token.strip()