Skip to content

Commit ffcbe74

Browse files
update the flows
1 parent 1ceaad7 commit ffcbe74

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/auto_review_documentation.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
AZURE_OPENAI_API_VERSION: "2024-12-01-preview"
2020
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
2121
REPO_NAME: "Azure-Samples/azure-ai-content-understanding-python"
22+
DOC_FILE_FILTER: '\.md$|\.rst$|README|\.ipynb$'
2223

2324
steps:
2425
- name: Checkout code
@@ -42,8 +43,11 @@ jobs:
4243
# Retrieve list of files changed between the previous commit and the current SHA
4344
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt
4445
# filter to include only documentation files (e.g., .md, .rst, README, .ipynb)
45-
grep -E '\.md$|\.rst$|README|\.ipynb$' changed_files.txt || true > changed_docs.txt
46+
grep -E "${DOC_FILE_FILTER}" changed_files.txt || true > changed_docs.txt
47+
echo "Files changed with DOC_FILE_FILTER (${DOC_FILE_FILTER}) — could be empty:"
48+
echo "---------------------------------------------------------------"
4649
cat changed_docs.txt
50+
echo "---------------------------------------------------------------"
4751
4852
- name: Azure Login
4953
uses: azure/login@v2
@@ -54,9 +58,13 @@ jobs:
5458

5559
- name: Run review script on each file
5660
run: |
57-
while read file; do
58-
if [ -n "$file" ]; then
59-
echo "Running review script on file: $file"
60-
INPUT_FILE_PATH="$file" python tools/review_file/review_file.py
61-
fi
62-
done < changed_docs.txt
61+
if [ ! -s changed_docs.txt ]; then
62+
echo "No documentation files changed matching DOC_FILE_FILTER (${DOC_FILE_FILTER}). Skipping review step."
63+
else
64+
while read file; do
65+
if [ -n "$file" ]; then
66+
echo "Running review script on file: $file"
67+
INPUT_FILE_PATH="$file" python tools/review_file/review_file.py
68+
fi
69+
done < changed_docs.txt
70+
fi

0 commit comments

Comments
 (0)