From 91564d18352a0dd8132a5dc2636a8d87266f3584 Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 14:28:23 +0100 Subject: [PATCH 1/6] ci: check the link of the book and of the API docs Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/check-links.yml diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000..407c4ca --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,38 @@ +name: Check Links + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: {} + + +jobs: + lychee: + strategy: + matrix: + tags: ["0.1.0", "0.2.0", "0.2.1", "0.3.0"] + + runs-on: ubuntu-latest + + steps: + - name: Check out repository code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + persist-credentials: false + + - name: Link Checker in the book + uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + with: + args: --root-dir tags/${{matrix.tags}}/book --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{matrix.tags}}/book + fail: false + + - name: Link Checker in the API docs + uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + with: + args: --root-dir tags/${{matrix.tags}}/. --require-https --no-progress --include-fragments --include-verbatim tags/${{matrix.tags}}/api + fail: false From 8f4e5cf3ffba08664203c1d42dfbaf8573b9a284 Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 15:31:16 +0100 Subject: [PATCH 2/6] ci: comment the link checker results Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 407c4ca..56f8670 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -8,7 +8,9 @@ on: branches: - main -permissions: {} +# commenting needs these +permissions: + pull-requests: write jobs: @@ -16,6 +18,7 @@ jobs: strategy: matrix: tags: ["0.1.0", "0.2.0", "0.2.1", "0.3.0"] + doc_types: ["api", "book"] runs-on: ubuntu-latest @@ -28,11 +31,16 @@ jobs: - name: Link Checker in the book uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 with: - args: --root-dir tags/${{matrix.tags}}/book --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{matrix.tags}}/book + args: --root-dir tags/${{ matrix.tags }}/${{ matrix.doc_types }} --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{ matrix.tags }}/${{ matrix.doc_types }} --output output.md fail: false - - name: Link Checker in the API docs - uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + - name: Format summary for comment + run: | + # Only keep the # Summary header and the table by deleting every thing after a ## Then add the matrix info to the heading + sed '/^##\s/,/$EOF/{d}' output.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}/${{ matrix.doc_types }}/g' > summary-comment.md + + - name: Comment Summary on PR + uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 with: - args: --root-dir tags/${{matrix.tags}}/. --require-https --no-progress --include-fragments --include-verbatim tags/${{matrix.tags}}/api - fail: false + header: ${{ matrix.tags }}/${{ matrix.doc_types }} + path: summary-comment.md \ No newline at end of file From 71c2babfc5c26223f348a7456c4a34de4542159e Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 15:33:25 +0100 Subject: [PATCH 3/6] fix: use predefined output from action config Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 56f8670..0dd3261 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -31,13 +31,13 @@ jobs: - name: Link Checker in the book uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 with: - args: --root-dir tags/${{ matrix.tags }}/${{ matrix.doc_types }} --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{ matrix.tags }}/${{ matrix.doc_types }} --output output.md + args: --root-dir tags/${{ matrix.tags }}/${{ matrix.doc_types }} --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{ matrix.tags }}/${{ matrix.doc_types }} fail: false - name: Format summary for comment run: | # Only keep the # Summary header and the table by deleting every thing after a ## Then add the matrix info to the heading - sed '/^##\s/,/$EOF/{d}' output.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}/${{ matrix.doc_types }}/g' > summary-comment.md + sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}/${{ matrix.doc_types }}/g' > summary-comment.md - name: Comment Summary on PR uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 From d078c53ccdae6178ba3f0b0adfee20c9e95c6d99 Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 15:43:46 +0100 Subject: [PATCH 4/6] fix: espace the slash properly Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 0dd3261..4a6ab82 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -37,7 +37,7 @@ jobs: - name: Format summary for comment run: | # Only keep the # Summary header and the table by deleting every thing after a ## Then add the matrix info to the heading - sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}/${{ matrix.doc_types }}/g' > summary-comment.md + sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}\/${{ matrix.doc_types }}/g' > summary-comment.md - name: Comment Summary on PR uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 From 3dd44c3e5d034fb7368e312304b9946aac9cbcf8 Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 15:53:05 +0100 Subject: [PATCH 5/6] ci: change the comment layout Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 4a6ab82..87595c6 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -1,9 +1,6 @@ name: Check Links on: - push: - branches: - - main pull_request: branches: - main @@ -18,7 +15,6 @@ jobs: strategy: matrix: tags: ["0.1.0", "0.2.0", "0.2.1", "0.3.0"] - doc_types: ["api", "book"] runs-on: ubuntu-latest @@ -31,16 +27,28 @@ jobs: - name: Link Checker in the book uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 with: - args: --root-dir tags/${{ matrix.tags }}/${{ matrix.doc_types }} --require-https --no-progress --include-fragments --include-verbatim -v '*.md' tags/${{ matrix.tags }}/${{ matrix.doc_types }} + args: --root-dir tags/${{ matrix.tags }}/book --require-https --no-progress --include-fragments --include-verbatim tags/${{ matrix.tags }}/book fail: false - name: Format summary for comment run: | + echo "# Summary ${{ matrix.tags }}" > summary-comment.md # Only keep the # Summary header and the table by deleting every thing after a ## Then add the matrix info to the heading - sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/# Summary ${{ matrix.tags }}\/${{ matrix.doc_types }}/g' > summary-comment.md + sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/## Api docs/g' >> summary-comment.md + + - name: Link Checker in the api docs + uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2 + with: + args: --root-dir tags/${{ matrix.tags }}/api --require-https --no-progress --include-fragments --include-verbatim tags/${{ matrix.tags }}/api + fail: false + + - name: Format summary for comment + run: | + # Only keep the # Summary header and the table by deleting every thing after a ## then + sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/## Api docs/g' >> summary-comment.md - name: Comment Summary on PR uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 with: - header: ${{ matrix.tags }}/${{ matrix.doc_types }} + header: ${{ matrix.tags }} path: summary-comment.md \ No newline at end of file From 7fe5674892c491f1685068df87503a432d848300 Mon Sep 17 00:00:00 2001 From: Antoine Lavandier Date: Wed, 4 Mar 2026 15:57:14 +0100 Subject: [PATCH 6/6] fix: correctly label results Signed-off-by: Antoine Lavandier --- .github/workflows/check-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 87595c6..db32f94 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -34,7 +34,7 @@ jobs: run: | echo "# Summary ${{ matrix.tags }}" > summary-comment.md # Only keep the # Summary header and the table by deleting every thing after a ## Then add the matrix info to the heading - sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/## Api docs/g' >> summary-comment.md + sed '/^##\s/,/$EOF/{d}' lychee/out.md | sed 's/^# Summary/## Book/g' >> summary-comment.md - name: Link Checker in the api docs uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2