참고소스 수정본
This commit is contained in:
23
참고/guardrails-main/.github/workflows/scripts/update_notebook_matrix.sh
vendored
Normal file
23
참고/guardrails-main/.github/workflows/scripts/update_notebook_matrix.sh
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
ignore=(chatbot.ipynb translation_with_quality_check.ipynb guardrails_server.ipynb)
|
||||
# Array to store notebook names
|
||||
notebook_names="["
|
||||
|
||||
# Compile list of file names
|
||||
for file in $(ls docs/examples/*.ipynb); do
|
||||
# Add the full filename with extension
|
||||
filename=$(basename "$file")
|
||||
if ! [[ ${ignore[*]} =~ "$filename" ]]
|
||||
then
|
||||
notebook_names+="\"$filename\","
|
||||
fi
|
||||
|
||||
done
|
||||
notebook_names="${notebook_names%,}]"
|
||||
|
||||
# echo $notebook_names
|
||||
|
||||
|
||||
# find line that begins with "notebook:" and replace it with notebook: $notebook_names
|
||||
sed "s/notebook: \[.*\]/notebook: $notebook_names/" .github/workflows/examples_check.yml > .github/workflows/examples_check.yml.tmp
|
||||
mv .github/workflows/examples_check.yml.tmp .github/workflows/examples_check.yml
|
||||
Reference in New Issue
Block a user