-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add CI to only use markdown extension for integrations #39283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,6 +14,16 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
node-version: 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||
cache: "npm" | ||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Check for .md files and suggest renaming | ||||||||||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Checking for .md files in source/_integrations..." | ||||||||||||||||||||||||||||||||||||||||||||||||||
MD_FILES=$(find source/_integrations -type f -name "*.md") | ||||||||||||||||||||||||||||||||||||||||||||||||||
if [ -n "$MD_FILES" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||
echo "Found the following .md files:" | ||||||||||||||||||||||||||||||||||||||||||||||||||
echo "$MD_FILES" | ||||||||||||||||||||||||||||||||||||||||||||||||||
echo "⚠️ Please rename these files from .md to .markdown" | ||||||||||||||||||||||||||||||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+17
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Guard against missing - name: Check for .md files and suggest renaming
run: |
- echo "Checking for .md files in source/_integrations..."
- MD_FILES=$(find source/_integrations -type f -name "*.md")
+ echo "Checking for .md files in source/_integrations..."
+ if [ -d source/_integrations ]; then
+ MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null)
+ else
+ MD_FILES=""
+ fi
if [ -n "$MD_FILES" ]; then
echo "Found the following .md files:"
echo "$MD_FILES" Alternatively, to quickly suppress errors: - MD_FILES=$(find source/_integrations -type f -name "*.md")
+ MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null || true) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||
run: npm install | ||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Handle missing
source/_integrations
directory to avoid false failuresIf the
source/_integrations
folder doesn’t exist, thefind
command will error out and cause the step to fail even when there are no.md
files. Guard against a missing directory or redirectfind
’s stderr so the workflow only fails when unwanted.md
files are truly present.Proposed diff:
📝 Committable suggestion
🤖 Prompt for AI Agents