#!/bin/bash

git fetch origin $GITHUB_BASE_REF --depth=1

git diff --diff-filter=A --name-only origin/$GITHUB_BASE_REF...HEAD \
| { grep -E '\.(ts)$' || true; } \
| { grep -Ev '(^\..+?/|config|test|spec|types)' || true; } \
> new_files.txt

touch new_files.txt

echo ""
echo "📂 New TS files (excluding config, test, spec, types, dot-dirs):"
cat new_files.txt | sed 's/^/- /' || echo "None"
echo ""