From 9aa39c90c2d206365b44e2c72ba95e3550cd3827 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Sat, 1 Aug 2026 19:37:24 +0800 Subject: [PATCH] fetch-docs: allow REPO/REPO_ID/NAME overrides from the environment Defaults are unchanged, so existing cron lines keep publishing the plain linuxcnc-doc artifact. Overriding the three values lets the same script publish a post-processed variant, such as the searchable docs built by LinuxCNC/doc-search, with the same trust checks (head_repository_id pin, sha256, tree sanity). --- fetch-docs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fetch-docs b/fetch-docs index 0c1dea8..20f110a 100755 --- a/fetch-docs +++ b/fetch-docs @@ -20,9 +20,14 @@ import urllib.request # Usage: fetch-docs.py [BRANCH] [WEBROOT] (one cron line per branch) # fetch-docs.py master /var/www/.../docs/devel # fetch-docs.py 2.9 /var/www/.../docs/stable -REPO = "LinuxCNC/linuxcnc" -REPO_ID = 3662905 # head_repository_id; use your fork id to test -NAME = "linuxcnc-doc.tar.gz" # upload-artifact archive:false names it after the file +# REPO/REPO_ID/NAME default to the plain docs artifact but can be overridden +# from the environment to publish a post-processed variant instead, e.g.: +# FETCH_DOCS_REPO=LinuxCNC/doc-search FETCH_DOCS_REPO_ID=1275651762 \ +# FETCH_DOCS_NAME=linuxcnc-doc-search.tar.gz \ +# fetch-docs.py master /var/www/.../docs/devel +REPO = os.environ.get("FETCH_DOCS_REPO", "LinuxCNC/linuxcnc") +REPO_ID = int(os.environ.get("FETCH_DOCS_REPO_ID", "3662905")) # head_repository_id; use your fork id to test +NAME = os.environ.get("FETCH_DOCS_NAME", "linuxcnc-doc.tar.gz") # upload-artifact archive:false names it after the file API_VER = "2026-03-10" TOKEN_FILE = os.path.expanduser("~/.config/linuxcnc-docs/token") # chmod 600, PAT actions:read BRANCH = sys.argv[1] if len(sys.argv) > 1 else "master"