Skip to content

Commit 990160f

Browse files
committed
nav fix
1 parent 9b76c0e commit 990160f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/check-url-changes.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Check Documentation URL Changes
33
on:
44
pull_request_target:
55
branches:
6-
- url-test
6+
- master # target branch of PR
77
paths:
88
- '**/*.md'
99
- '**/.nav.yml'
10-
\
10+
- '**/.nav.yaml'
1111

1212
jobs:
1313
check-url-changes:
@@ -34,7 +34,7 @@ jobs:
3434
echo "$RENAMED_FILES" >> $GITHUB_ENV
3535
echo "EOF" >> $GITHUB_ENV
3636
37-
# Deleted nav files
37+
# Deleted nav files (.nav.yml or .nav.yaml)
3838
DELETED_NAV_FILES=$(git diff --name-status origin/master ${{ github.event.pull_request.head.sha }} | grep '^D.*\.nav\.ya?ml$' | cut -f2- || true)
3939
4040
# Modified nav files
@@ -63,12 +63,12 @@ jobs:
6363
echo "warning=false" >> $GITHUB_ENV
6464
fi
6565
66-
# Log changes
66+
# Log for debugging
6767
echo "Deleted markdown files:"
6868
echo "$DELETED_FILES"
6969
echo -e "\nRenamed/Moved markdown files:"
7070
echo "$RENAMED_FILES"
71-
echo -e "\nNav file changes:"
71+
echo -e "\nNav file changes (deleted/modified):"
7272
echo -e "$NAV_CHANGES"
7373
7474
- name: Post PR warning
@@ -94,7 +94,15 @@ jobs:
9494
}
9595
9696
if (navChanges) {
97-
message += `**Modified or deleted navigation files:**\n\`\`\`\n${navChanges}\n\`\`\`\n\n`;
97+
// Highlight deleted nav files separately
98+
const navLines = navChanges.split('\n').map(line => {
99+
if (line.includes('[FILE DELETED]')) {
100+
return `❌ ${line.replace(':', '')}`; // mark deleted files with ❌
101+
}
102+
return line;
103+
}).join('\n');
104+
105+
message += `**Modified or deleted navigation files:**\n\`\`\`\n${navLines}\n\`\`\`\n\n`;
98106
}
99107
100108
message += `🚨 Please review these changes carefully 🚨\n\nIf not handled properly, broken links (404 errors) could appear. To maintain a smooth user experience, consider:\n- Adding redirects in the \`mkdocs.yml\` file from the old URLs to the new ones\n- Updating internal references to these files\n- Verifying that the navigation structure still matches the intended URLs.`;

0 commit comments

Comments
 (0)