Skip to content

release-docs: prepare-publish bases publish commit on stale branch tip, dropping LFS .gitattributes #141

Description

@kojiromike

Problem

The release-docs.yml workflow can publish the b10 SchemaSpy tree as raw file content instead of git-lfs pointers, defeating the git-lfs design from #139 and bloating the Hugo repo. Observed on the retroactive 8.1.0 production run: PR #129 contained +1,040,333 lines across 891 files (raw HTML + vendored bower assets) rather than ~3-line LFS pointers.

Root cause

tools/release-docs/Taskfile.ymlworkflow:prepare-publish bases the publish commit on the existing remote branch tip:

if git -C "$PUBLISH" fetch ... "+refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}"; then
  git -C "$PUBLISH" checkout -B "$BRANCH" "origin/${BRANCH}"   # <-- swaps working tree to old branch content
else
  git -C "$PUBLISH" checkout -B "$BRANCH"                       # fresh from master clone
fi

The depth-1 clone is of master (which has the static/documentation/*/b10/** filter=lfs rule in .gitattributes). But when origin/$BRANCH already exists, checkout -B "$BRANCH" origin/$BRANCH switches the working tree to that branch's content. For release-docs/8.1.0 — created 2026-05-27, before the .gitattributes rule landed in #139 — the branch has no .gitattributes, so the LFS clean filter never matches and the tree commits as raw content. Every subsequent dispatch inherits the missing attribute and keeps storing raw content.

The test branch (release-docs-test/8.1.0) is unaffected only because it never existed before #139 and so always took the fresh-from-master path.

Impact

  • Any release-docs/<v> branch created before the .gitattributes rule will publish raw content if re-dispatched (latent on release-docs/8.1.6, release-docs/8.1.7).
  • More generally, future changes to .gitattributes on master won't propagate to existing publish branches.

Suggested fix

Base the publish branch on origin/master each dispatch (e.g. checkout -B "$BRANCH" origin/master) so it always carries master's .gitattributes, rather than accumulating on the stale branch tip. (update-manifest already mutates $PUBLISH/data/releases.json, which would then come from master's live manifest — the desired source anyway.) Alternatively, explicitly restore .gitattributes from master before git add.

Workaround applied for 8.1.0

Deleted the stale release-docs/8.1.0 branch (auto-closed PR #129) and re-dispatched, forcing the fresh-from-master path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    github_actionsPull requests that update GitHub Actions code

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions