Repository navigation
fix(release): commit only non-ignored dist on finalize - #1163
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release-core.yml's finalize step passed the wholedistdirectory tocommit-action(FILE_PATHS: CHANGELOG.md,dist) for bundle projects.commit-actionwalks a directory path on disk and force-adds every file itfinds — it never consults
.gitignore(findFilesRecursivelyincommit-runner.tsskips only.git) — so the gitignored tsc/ncc byproducts(
dist/src/**,*.tsbuildinfo) were re-committed on every final release. Thisre-tracked them on
main, ondev(viasync-main-to-dev), and in the tagtree, defeating the "ship only the bundle" invariant and making the sanctioned
git rm --cachedcleanup impossible to persist — it re-bit as a release-PRDist Checkfailure whenever an ncc/tsc-affecting dep bump drifted the emit onthe un-gated
devbranch (what blockedsync-issues-actionv0.4.0).Fix
Scoped to
release-core.yml(issue's option 1 — respect existing tracking, nohardcode). The
Build release artifactstep now computes thetracked-plus-untracked-but-not-ignored set under
distwith:i.e.
git add/.gitignoresemantics — and exposes it as a step output. Thefinalize commit's
FILE_PATHSthreads that explicit list instead of the baredistdir, so only the real bundle (dist/index.js,dist/licenses.txt)reaches the tag.
--exclude-standardstops re-adding gitignored untrackedemit, so once a consumer runs the documented
git rm --cachedcleanup it nowpersists 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 stepcomputes non-ignored paths via
git ls-files -co --exclude-standard, andFILE_PATHS threads the computed output.
Related
Distinct from #1157 (native promote floating-tag create 422); both surfaced on
the same
sync-issues-actionv0.4.0 /commit-actionv0.3.1 release trains. Themore general
commit-action-level fix (honor.gitignorefor directory paths)remains available as a follow-up in that repo.
Closes #1159