From 09ba829cc3ac772b68c6a15b26aaac923a9ef882 Mon Sep 17 00:00:00 2001 From: Jack Arturo Date: Mon, 19 Oct 2026 16:04:34 -0400 Subject: [PATCH 1/2] ci(docs): dispatch docs updates on releases only Docs on automem.ai follow published releases. docs-dispatch.yml becomes a reusable workflow that release-please.yml calls once a release is created, diffing the release against the previous release tag. A manual run documents a given release tag, or the latest release by default. The payload adds release_tag and release_version and drops head_sha and commit_url, since client_payload allows at most 10 top-level properties. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/docs-dispatch.yml | 83 ++++++++++++++-------------- .github/workflows/release-please.yml | 15 +++++ 2 files changed, 55 insertions(+), 43 deletions(-) diff --git a/.github/workflows/docs-dispatch.yml b/.github/workflows/docs-dispatch.yml index 6d455bb..17fcb26 100644 --- a/.github/workflows/docs-dispatch.yml +++ b/.github/workflows/docs-dispatch.yml @@ -1,15 +1,25 @@ name: Docs Dispatch +# Docs on automem.ai follow published releases, so this runs once per release: +# release-please.yml calls it after creating one. A manual run documents a +# release tag (the latest release by default), which also covers a release +# published by hand, since that never sets release_created. + on: - push: - branches: [main] - workflow_dispatch: + workflow_call: inputs: - base_sha: - description: "Base SHA or ref for the docs diff. Defaults to head^." + release_tag: + description: "Release tag to document." + required: true + type: string + reason: + description: "Why docs should be audited." required: false - head_sha: - description: "Head SHA or ref to document. Defaults to main." + type: string + workflow_dispatch: + inputs: + release_tag: + description: "Release tag to document. Defaults to the latest release." required: false reason: description: "Why docs should be audited." @@ -29,51 +39,35 @@ jobs: - name: Get changed files id: changed env: - EVENT_NAME: ${{ github.event_name }} - INPUT_BASE_REF: ${{ inputs.base_sha }} - INPUT_HEAD_REF: ${{ inputs.head_sha }} + GH_TOKEN: ${{ github.token }} + INPUT_RELEASE_TAG: ${{ inputs.release_tag }} INPUT_REASON: ${{ inputs.reason }} - PUSH_BASE_REF: ${{ github.event.before }} - PUSH_HEAD_REF: ${{ github.event.after }} run: | - ZERO_SHA="0000000000000000000000000000000000000000" - - if [ "$EVENT_NAME" = "workflow_dispatch" ]; then - HEAD_REF="${INPUT_HEAD_REF:-main}" - BASE_REF="$INPUT_BASE_REF" - REASON="${INPUT_REASON:-Manual docs dispatch for ${HEAD_REF}}" - else - HEAD_REF="$PUSH_HEAD_REF" - BASE_REF="$PUSH_BASE_REF" - REASON="Push to main" - fi - - HEAD_SHA=$(git rev-parse "$HEAD_REF") - - if [ -z "$BASE_REF" ]; then - if git rev-parse --verify "${HEAD_REF}^" >/dev/null 2>&1; then - BASE_REF="${HEAD_REF}^" - else - BASE_REF=$(git rev-list --max-parents=0 --max-count=1 "$HEAD_SHA") - fi + RELEASE_TAG="$INPUT_RELEASE_TAG" + if [ -z "$RELEASE_TAG" ]; then + RELEASE_TAG=$(gh api "repos/${GITHUB_REPOSITORY}/releases/latest" -q '.tag_name') fi + git fetch --tags --force origin - if [ "$BASE_REF" = "$ZERO_SHA" ]; then - echo "::warning::No previous SHA found, diffing against first commit" - BASE_SHA=$(git rev-list --max-parents=0 --max-count=1 "$HEAD_SHA") + HEAD_SHA=$(git rev-parse "${RELEASE_TAG}^{commit}") + # Diff against the previous release so the docs audit sees the whole release. + if PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match 'automem-graph-viewer-v*' "${HEAD_SHA}^" 2>/dev/null); then + BASE_SHA=$(git rev-parse "${PREVIOUS_TAG}^{commit}") else - BASE_SHA=$(git rev-parse "$BASE_REF") + echo "::warning::No previous release tag found, diffing against first commit" + BASE_SHA=$(git rev-list --max-parents=0 --max-count=1 "$HEAD_SHA") fi + REASON="${INPUT_REASON:-Release ${RELEASE_TAG}}" - COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${HEAD_SHA}" COMPARE_URL="https://github.com/${GITHUB_REPOSITORY}/compare/${BASE_SHA}...${HEAD_SHA}" FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | jq -R -s -c 'split("\n") | map(select(. != ""))') { + echo "release_tag=$RELEASE_TAG" + echo "release_version=${RELEASE_TAG##*v}" echo "base_sha=$BASE_SHA" echo "head_sha=$HEAD_SHA" echo "files=$FILES" - echo "commit_url=$COMMIT_URL" echo "compare_url=$COMPARE_URL" echo "reason< Date: Mon, 19 Oct 2026 16:10:01 -0400 Subject: [PATCH 2/2] docs(agents): describe release-only docs dispatch Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index ab003b6..f9c2a0a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,5 +75,5 @@ The dev server proxies `/graph`, `/recall`, `/memory`, and `/health` to `VITE_AP - `ci.yml`: `npm ci → lint → build` plus a smoke check on cache headers. - Release Please (`release-please.yml`) manages version bumps/changelog from conventional commits — **never** manually bump `package.json` version. -- `docs-dispatch.yml`: pushes to `main` dispatch a `docs-update` event to `verygoodplugins/automem-website` for files mapped in that repo's `file-doc-map.json`. +- `docs-dispatch.yml`: runs once per release (the `docs-dispatch` job in `release-please.yml` calls it after a release is created) and dispatches a `docs-update` event to `verygoodplugins/automem-website` for files mapped in that repo's `file-doc-map.json`, diffed against the previous release tag. Docs on automem.ai follow published releases, not every push to `main`. A manual run documents a given release tag (the latest by default). - `docker-build.yml` builds the container; Railway deploys via `railway.toml` + `Dockerfile`.