Skip to content

Commit be16b1b

Browse files
committed
improve security for the stylebot.
1 parent b0550a6 commit be16b1b

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/pr_style_bot.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,33 @@ jobs:
6464
run: |
6565
pip install .[quality]
6666
67-
- name: Download Makefile from main branch
67+
- name: Download necessary files from main branch of Diffusers
6868
run: |
6969
curl -o main_Makefile https://raw.githubusercontent.com/huggingface/diffusers/main/Makefile
70+
curl -o main_setup.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/setup.py
71+
curl -o main_check_doc_toc.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/utils/check_doc_toc.py
7072
71-
- name: Compare Makefiles
73+
- name: Compare the files and raise error if needed
7274
run: |
75+
diff_failed=0
76+
7377
if ! diff -q main_Makefile Makefile; then
7478
echo "Error: The Makefile has changed. Please ensure it matches the main branch."
75-
exit 1
79+
diff_failed=1
80+
fi
81+
82+
if ! diff -q main_setup.py setup.py; then
83+
echo "Error: The setup.py has changed. Please ensure it matches the main branch."
84+
diff_failed=1
7685
fi
77-
echo "No changes in Makefile. Proceeding..."
78-
rm -rf main_Makefile
86+
87+
if ! diff -q main_check_doc_toc.py utils/check_doc_toc.py; then
88+
echo "Error: The utils/check_doc_toc.py has changed. Please ensure it matches the main branch."
89+
diff_failed=1
90+
fi
91+
92+
echo "No changes in the files. Proceeding..."
93+
rm -rf main_Makefile main_setup.py main_check_doc_toc.py
7994
8095
- name: Run make style and make quality
8196
run: |

0 commit comments

Comments
 (0)