Skip to content

Commit 848ccd7

Browse files
committed
fix: include untracked files in source zip so new files deploy before commit
1 parent 7b6e92f commit 848ccd7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/deploy-with-codebuild.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ def get_stack_outputs(stack_name: str) -> Dict[str, str]:
152152

153153
def _collect_files_git(repo_root: Path) -> Optional[List[str]]:
154154
"""
155-
Collect tracked files using git ls-files.
155+
Collect project files using git ls-files.
156+
157+
Includes tracked files and untracked files that aren't gitignored,
158+
so new files are picked up before commit/stage.
156159
157160
Args:
158161
repo_root: Path to the repository root
@@ -162,7 +165,7 @@ def _collect_files_git(repo_root: Path) -> Optional[List[str]]:
162165
"""
163166
try:
164167
result = run_command(
165-
command=["git", "ls-files", "-z"],
168+
command=["git", "ls-files", "--cached", "--others", "--exclude-standard", "-z"],
166169
cwd=str(repo_root),
167170
)
168171
return [f for f in result.stdout.split("\0") if f]

0 commit comments

Comments
 (0)