Skip to content

Commit

Permalink
Accepting relative links.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giom-V committed Sep 12, 2024
1 parent 7d91cb2 commit 06c9091
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/new_examples_links_in_table_of_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ jobs:
while IFS= read -r file; do
# Get the directory of the new example file
example_dir=$(dirname "$file")
# Get the filename without the directory path
filename=$(basename "$file")
# Check if link exists in examples/README.md
if ! grep -q "$file" examples/README.md && ! grep -q "${file/examples\//](}" examples/README.md; then
# Check if a README.md exists in the sub-folder, and if so, check for the link there
if [[ -f "$example_dir/README.md" ]]; then
if ! grep -q "$file" "$example_dir/README.md" && ! grep -q "${file/examples\//](}" "$example_dir/README.md"; then
if ! grep -q "$filename" "$example_dir/README.md" && ! grep -q "$filename" "$example_dir/README.md"; then
all_linked=false
echo "Link to '$file' not found in examples/README.md or $example_dir/README.md"
echo "::warning file=$file::Link to '$file' not found in a README.md, please add one"
Expand Down

0 comments on commit 06c9091

Please sign in to comment.