Skip to content

Commit 7bf6084

Browse files
authored
Add broken link checker
1 parent cf4aad3 commit 7bf6084

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Doc links
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
pull_request:
8+
9+
jobs:
10+
link_check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
- name: Asciidoc-link-checker
18+
run: npm install -g asciidoc-link-check
19+
- name: Run asciidoc-link-check
20+
run: |
21+
git clone https://github.com/${{ github.repository_owner }}/faas-bb.git
22+
cd faas-bb
23+
git checkout ${{ github.head_ref || github.ref_name }}
24+
find . -name '*.adoc' -exec sh -c 'asciidoc-link-check -p "{}" || echo "error"' \; | grep -q "error" && exit 1 || exit 0

.github/workflows/faas_fn_build_invoke.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ jobs:
2929
DOCKER_REGISTRY_IMG_ORG_PATH: ghcr.io/${{ github.repository_owner }}
3030
run: |
3131
git clone https://github.com/${{ github.repository_owner }}/faas-bb.git
32-
cd faas-bb/examples
32+
cd faas-bb
3333
git checkout ${{ github.head_ref || github.ref_name }}
34+
cd examples
3435
faas template pull https://github.com/${{ github.repository_owner }}/faas-bb#${{ github.head_ref || github.ref_name }}
3536
faas build
3637
if [ "$(echo world | docker run -i ghcr.io/${{ github.repository_owner }}/bb-hello:latest ./index.clj)" != "Hello, world" ]; then

README.adoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
:img-ci-tests-status: {url-proj}/actions/workflows/faas_fn_build_invoke.yml/badge.svg
33
:img-ci-hadolint-status: {url-proj}/actions/workflows/hadolint.yml/badge.svg
44
:img-ci-clj-kondo-status: {url-proj}/actions/workflows/clj-kondo.yml/badge.svg
5+
:img-ci-lychee-link-check-status: {url-proj}/actions/workflows/broken-link-checker.yml/badge.svg
56
:url-ci-status-tests: "{url-proj}/actions/workflows/faas_fn_build_invoke.yml"
67
:url-ci-status-hadolint: "{url-proj}/actions/workflows/hadolint.yml"
78
:url-ci-status-clj-kondo: "{url-proj}/actions/workflows/clj-kondo.yml"
9+
:url-ci-status-lychee-link: "{url-proj}/actions/workflows/broken-link-checker.yml"
810
:img-license: https://img.shields.io/badge/license-MIT-black.svg
911

1012
= OpenFaaS Babashka template =
1113

1214
image:{img-ci-tests-status}[link={url-ci-status-tests}]
1315
image:{img-ci-hadolint-status}[link={url-ci-status-hadolint}]
1416
image:{img-ci-clj-kondo-status}[link={url-ci-status-clj-kondo}]
17+
image:{img-ci-lychee-link-check-status}[link={url-ci-status-lychee-link}]
1518
image:{img-license}[link=LICENSE]
1619

1720
An https://github.com/openfaas[OpenFaaS] template for writing Functions in https://github.com/babashka/babashka[Babashka].
@@ -47,7 +50,7 @@ A new project is created for a function defined as `my-bb-function`. It will con
4750

4851
OpenFaaS watchdog is `of-watchdog` in https://github.com/openfaas/of-watchdog#3-streaming-fork-modestreaming---default[Streaming fork] mode.
4952

50-
== link:function-examples[Function examples] ==
53+
== link:examples[Function examples] ==
5154

5255
See the link:examples[examples] directory to find a fully working set of OpenFaaS Functions written in Babashka.
5356

0 commit comments

Comments
 (0)