linkcheck #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # Check for dead links in the the documentation. | |
| # | |
| # Links to ignore are set in doc/conf.py | |
| # (see ``linkcheck_.*`` variables). | |
| # | |
| ### | |
| name: linkcheck | |
| on: | |
| schedule: | |
| # Uses the cron schedule for github actions | |
| # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule | |
| # ┌───────────── minute (0 - 59) | |
| # │ ┌───────────── hour (0 - 23) | |
| # │ │ ┌───────────── day of the month (1 - 31) | |
| # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
| # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
| # │ │ │ │ │ | |
| # │ │ │ │ │ | |
| # │ │ │ │ │ | |
| # * * * * * | |
| # Runs at 00:00, on day 1 of every 3rd month | |
| - cron: 0 0 1 */3 * | |
| # This enables manual triggering from GitHub UI | |
| # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Force to use color | |
| FORCE_COLOR: true | |
| jobs: | |
| # check the links in the doc | |
| linkcheck: | |
| if: github.repository == 'nilearn/nilearn' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout nilearn | |
| uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install packages | |
| run: uv tool install tox --with=tox-uv --with=tox-gh-actions | |
| - name: check links | |
| id: linkcheck | |
| run: tox run -e linkcheck | |
| continue-on-error: true | |
| - name: Create issue | |
| if: ${{ steps.linkcheck.outcome != 'success' }} | |
| uses: JasonEtco/create-an-issue@v2.9.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run_id: ${{ github.run_id }} | |
| repository: ${{ github.repository }} | |
| workflow_name: LINKCHECK | |
| with: | |
| filename: .github/workflow_failure.md | |
| update_existing: true | |
| search_existing: open | |
| - name: Return failure | |
| if: ${{ steps.linkcheck.outcome != 'success' }} | |
| run: exit 1 |