Skip to content

Commit 4cfc8d4

Browse files
authored
Merge pull request #544 from contentstack/feature/workflow
workflow changes 123456
2 parents b511158 + 0b3d03e commit 4cfc8d4

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/repo-sync.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,32 @@ jobs:
142142
rsync -av --delete ${{ env.RSYNC_SITECORE_UPLOAD_API_SRC_EXCLUDES }} ../upload-api/src/ ./upload-api/src/
143143
rsync -av --delete ../upload-api/migration-sitecore/ ./upload-api/migration-sitecore/
144144
145+
# Ensure tsconfig.json exists, create a default one if missing
146+
if [ ! -f "tsconfig.json" ]; then
147+
echo "Creating default tsconfig.json..."
148+
cat <<EOL > tsconfig.json
149+
{
150+
"compilerOptions": {
151+
"target": "ES6",
152+
"module": "CommonJS",
153+
"strict": true,
154+
"esModuleInterop": true,
155+
"skipLibCheck": true,
156+
"forceConsistentCasingInFileNames": true
157+
},
158+
"include": ["src/**/*"],
159+
"exclude": ["node_modules", "dist"]
160+
}
161+
EOL
162+
fi
163+
164+
# Remove unused imports
145165
npx ts-remove-unused-imports
146-
npx ts-prune | awk '{print $1}' | xargs sed -i '' -e '/import/d'
166+
167+
# Remove missing imports
168+
npx ts-prune | awk '{print $1}' | xargs -I {} sed -i '/import/d' {}
169+
170+
# Format code
147171
npx prettier --write .
148172
149173
git add .

0 commit comments

Comments
 (0)