Skip to content

Commit

Permalink
Merge pull request #238 from flatironinstitute/ci_absolute_link_to_docs
Browse files Browse the repository at this point in the history
prevent absolute links to docs (except badge)
  • Loading branch information
BalzaniEdoardo authored Oct 3, 2024
2 parents 37c50f2 + 7b07727 commit 57ed379
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

prevent_docs_absolute_links:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Make .sh executable
run: chmod +x bash_scripts/prevent_absolute_links_to_docs.sh

- name: Check links
run: ./bash_scripts/prevent_absolute_links_to_docs.sh

check:
if: ${{ !github.event.pull_request.draft }}
needs: tox
Expand Down
9 changes: 9 additions & 0 deletions bash_scripts/prevent_absolute_links_to_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Check for any unallowed absolute links in documentation excluding the badge.
if grep -r -E https?://nemos.* docs/ | grep -v "badge"; then
echo "Error: Unallowed absolute links found in documentation." >&2
exit 1
else
echo "No unallowed absolute links found."
fi

0 comments on commit 57ed379

Please sign in to comment.