script: API v2 accepts `position` param rather than `order`
What changed, and why it matters
This is a routine maintenance update to a GitHub automation script that publishes Core Lightning's RPC documentation to a documentation platform. The script's API call now uses the parameter name 'position' instead of 'order' because the documentation platform changed its API. It also updates the target branch from '1' to 'stable' and improves log messages. There is no security relevance.
No security action needed. Treat as normal CI/documentation maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies .github/scripts/sync-rpc-cmds.py, a CI helper that syncs manpage documentation to a documentation hosting API. Changes: (1) renames the ‘order’ parameter/field to ‘position’ to match API v2; (2) changes the category URI branch from ‘/branches/1/’ to ‘/branches/stable/’; (3) improves error/success logging; (4) reduces the sleep between requests from 3s to 1s. No cryptographic, network-facing, or node logic is touched.
Changed components
.github/scripts/sync-rpc-cmds.pyInspect captured patch +14 / −13
diff --git a/.github/scripts/sync-rpc-cmds.py b/.github/scripts/sync-rpc-cmds.py
index a9c3ef31..1657900d 100644
--- a/.github/scripts/sync-rpc-cmds.py
+++ b/.github/scripts/sync-rpc-cmds.py
@@ -47,7 +47,7 @@ def check_renderable(response, action, title):
return True
-def publishDoc(action, title, body, order, headers):
+def publishDoc(action, title, body, position, headers):
payload = {
"title": title,
"type": "basic",
@@ -55,45 +55,45 @@ def publishDoc(action, title, body, order, headers):
"body": body,
},
"category": {
- "uri": f"/branches/1/categories/reference/{CATEGORY_SLUG}"
+ "uri": f"/branches/stable/categories/reference/{CATEGORY_SLUG}"
},
"hidden": False,
- "order": order,
+ "position": position,
}
if action == Action.ADD:
payload["slug"] = title
response = requests.post(URL + "/reference", json=payload, headers=headers)
if response.status_code != 201:
- print("❌ HTTP ERROR:", response.status_code)
+ print(f"❌ HTTP ERROR ({response.status_code}):", title)
print(response.text)
return
if not check_renderable(response, action, title):
raise RuntimeError(f"Renderable check failed for {title}")
- print("✅ Created", title)
+ print(f"✅ Created '{title}' at position {position + 1}")
elif action == Action.UPDATE:
response = requests.patch(f"{URL}/reference/{title}", json=payload, headers=headers)
if response.status_code != 200:
- print("❌ HTTP ERROR:", response.status_code)
+ print(f"❌ HTTP ERROR ({response.status_code}):", title)
print(response.text)
return
if not check_renderable(response, action, title):
raise RuntimeError(f"Renderable check failed for {title}")
- print("✅ Updated", title)
+ print(f"✅ Updated '{title}' to position {position + 1}")
elif action == Action.DELETE:
response = requests.delete(f"{URL}/reference/{title}", headers=headers)
if response.status_code != 204:
- print("❌ DELETE FAILED:", title)
+ print(f"❌ DELETE FAILED ({response.status_code}):", title)
print(response.text)
else:
- print("🗑️ Deleted", title)
+ print(f"🗑️ Deleted '{title}' from position {position + 1}")
else:
print("Invalid action")
@@ -139,13 +139,14 @@ def main():
sleep(3)
if commands_from_local:
- order = 0
+ position = 0
for name, file in commands_from_local:
with open("doc/" + file) as f:
body = f.read()
- publishDoc(Action.ADD if name in commands_to_add else Action.UPDATE, name, body, order, headers)
- order = order + 1
- sleep(3)
+ action = Action.ADD if name in commands_to_add else Action.UPDATE
+ publishDoc(action, name, body, position, headers)
+ position += 1
+ sleep(1)
else:
print("No commands found in the Manpages block.")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.