Skip to content

fix(release): commit only non-ignored dist on finalize - #1163

Merged
c-vigo merged 3 commits into
devfrom
bugfix/1159-release-core-dist-gitignore
Jul 16, 2026
Merged

c-vigo merged 3 commits into
devfrom
bugfix/1159-release-core-dist-gitignore

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

release-core.yml's finalize step passed the whole dist directory to
commit-action (FILE_PATHS: CHANGELOG.md,dist) for bundle projects.
commit-action walks a directory path on disk and force-adds every file it
finds — it never consults .gitignore (findFilesRecursively in
commit-runner.ts skips only .git) — so the gitignored tsc/ncc byproducts
(dist/src/**, *.tsbuildinfo) were re-committed on every final release. This
re-tracked them on main, on dev (via sync-main-to-dev), and in the tag
tree, defeating the "ship only the bundle" invariant and making the sanctioned
git rm --cached cleanup impossible to persist — it re-bit as a release-PR
Dist Check failure whenever an ncc/tsc-affecting dep bump drifted the emit on
the un-gated dev branch (what blocked sync-issues-action v0.4.0).

Fix

Scoped to release-core.yml (issue's option 1 — respect existing tracking, no
hardcode). The Build release artifact step now computes the
tracked-plus-untracked-but-not-ignored set under dist with:

git ls-files -co --exclude-standard -- dist

i.e. git add/.gitignore semantics — and exposes it as a step output. The
finalize commit's FILE_PATHS threads that explicit list instead of the bare
dist dir, so only the real bundle (dist/index.js, dist/licenses.txt)
reaches the tag. --exclude-standard stops re-adding gitignored untracked
emit, so once a consumer runs the documented git rm --cached cleanup it now
persists across future finalize commits (already-tracked files still ship
until cleaned up — no regression). A guard fails the build loud if the bundle
recipe somehow produces no non-ignored files.

Tests

  • tests/test_release_core_dist_gitignore.py — new workflow-shape test
    (RED→GREEN, TDD): FILE_PATHS no longer passes bare dist, the build step
    computes non-ignored paths via git ls-files -co --exclude-standard, and
    FILE_PATHS threads the computed output.
  • Full pre-commit suite green (incl. actionlint); 157 fast pytest cases pass.

Related

Distinct from #1157 (native promote floating-tag create 422); both surfaced on
the same sync-issues-action v0.4.0 / commit-action v0.3.1 release trains. The
more general commit-action-level fix (honor .gitignore for directory paths)
remains available as a follow-up in that repo.

Closes #1159

@c-vigo
c-vigo enabled auto-merge July 16, 2026 20:34
@c-vigo
c-vigo merged commit 768ad51 into dev Jul 16, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1159-release-core-dist-gitignore branch July 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant