You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by me...@apache.org on 2026/07/14 20:35:27 UTC
(fineract-site) 02/03: help doc updater with commit log message
This is an automated email from the ASF dual-hosted git repository.
meonkeys pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/fineract-site.git
commit c266d890994859969468f8e59b755a3a022fb0a0
Author: Adam Monsen <ha...@gmail.com>
AuthorDate: Tue Jul 14 13:25:30 2026 -0700
help doc updater with commit log message
Coded by Claude (model=Sonnet 5, effort=High).
I made edits (e.g. add_to_git), reviewed, and tested this.
---
.github/workflows/generate-static-site.yml | 1 +
.gitignore | 3 +++
README.md | 7 +++++++
scripts/generate_docs.py | 28 +++++++++++++++++++++++-----
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/generate-static-site.yml b/.github/workflows/generate-static-site.yml
index 00f7aa5..6da81dd 100644
--- a/.github/workflows/generate-static-site.yml
+++ b/.github/workflows/generate-static-site.yml
@@ -50,6 +50,7 @@ jobs:
--exclude 'README.md' \
--exclude 'CONTRIBUTING.md' \
--exclude 'LICENSE.txt' \
+ --exclude 'DOCS-LOG-MESSAGE' \
.build/site/ ./
- name: Commit and push generated output
diff --git a/.gitignore b/.gitignore
index 8c58332..cd9ceee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,6 @@ site-src/resources/
# Hugo lock file
site-src/.hugo_build.lock
+
+# Generated commit message for docs/VERSION updates (scripts/generate_docs.py)
+/DOCS-LOG-MESSAGE
diff --git a/README.md b/README.md
index 45894e4..9c1f920 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,13 @@ into `docs/VERSION/index.html`, then rewrites the Google Fonts and Font Awesome
CDN links to point at the site's local `css/` stylesheets. Versions ending in
`-SNAPSHOT` are overwritten; released versions are not.
+It also writes and `git add`s a `DOCS-LOG-MESSAGE` file (git-ignored) with a suggested commit message referencing the source commit.
+Use it to commit the update:
+
+```bash
+git commit -F DOCS-LOG-MESSAGE
+```
+
## Verifying ASF project website compliance
Apache Whimsy periodically checks that the public homepage follows ASF conventions.
diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py
index 3ffb3f9..bcd878b 100644
--- a/scripts/generate_docs.py
+++ b/scripts/generate_docs.py
@@ -34,6 +34,7 @@ from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
DEFAULT_BACKEND_DIR = "/fineract"
DOC_HTML_RELATIVE_PATH = Path("fineract-doc/build/docs/html/en/index.html")
+COMMIT_MESSAGE_PATH = REPO_ROOT / "DOCS-LOG-MESSAGE"
# Same substitution made by hand in commits like e70425660b42fc705760006141078e870df0a566.
GOOGLE_FONTS_LINK = (
@@ -92,6 +93,22 @@ def get_commit_hash(backend_dir):
return run_git(backend_dir, "rev-parse", "HEAD").stdout.strip()
+def add_to_git(repo_dir, file):
+ return run_git(repo_dir, "add", file).stdout.strip()
+
+
+def write_commit_message(version, commit_hash):
+ message = (
+ f"update /docs/{version}\n"
+ "\n"
+ "docs built with `./gradlew asciidoctor` from "
+ f"https://github.com/apache/fineract/commit/{commit_hash}\n"
+ "\n"
+ "added here using the `fineract-site docs`"
+ )
+ COMMIT_MESSAGE_PATH.write_text(message, encoding="utf-8")
+
+
def localize_stylesheets(html_path):
text = html_path.read_text(encoding="utf-8")
text = text.replace(GOOGLE_FONTS_LINK, LOCAL_STYLESHEET_LINK)
@@ -119,11 +136,6 @@ def main():
commit_hash = get_commit_hash(backend_dir)
print(f"Backend commit: {commit_hash}")
- github_output = os.environ.get("GITHUB_OUTPUT")
- if github_output:
- with open(github_output, "a", encoding="utf-8") as f:
- f.write(f"fineract_commit={commit_hash}\n")
-
dest_dir = REPO_ROOT / "docs" / args.version
dest_html = dest_dir / "index.html"
is_snapshot = args.version.endswith("-SNAPSHOT")
@@ -139,6 +151,12 @@ def main():
localize_stylesheets(dest_html)
print(f"Wrote {dest_html}")
+ add_to_git(dest_dir, dest_html)
+ print(f"Added {dest_html} to Git index")
+
+ write_commit_message(args.version, commit_hash)
+ print(f"Wrote {COMMIT_MESSAGE_PATH}")
+ print(f"Run: git commit -F {COMMIT_MESSAGE_PATH.name}")
if __name__ == "__main__":