We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a11361a + a2864a5 commit 9079d68Copy full SHA for 9079d68
1 file changed
.github/workflows/articles.yml
@@ -22,7 +22,13 @@ jobs:
22
for dir in */; do
23
if [ -d "$dir" ]; then
24
cd "$dir"
25
- ls *.md 2>/dev/null | jq -R -s -c 'split("\n")[:-1]' > index.json
+ # Remove old index
26
+ rm -f index.json
27
+ # Create new index only if markdown files exist
28
+ if find . -maxdepth 1 -name "*.md" | grep -q .; then
29
+ find . -maxdepth 1 -name "*.md" -exec basename {} \; | \
30
+ jq -R -s -c 'split("\n")[:-1]' > index.json
31
+ fi
32
cd ..
33
fi
34
done
0 commit comments