From 9667f9995419036e92aac780d16f01dab5395386 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Sat, 27 Jul 2024 09:38:44 +0200 Subject: [PATCH] Add env. variable support --- README.md | 11 ++++++++--- ci/linkcheck.sh | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 500dcf9e43..75ebdeede9 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ The build files are found in the `book/html` directory. We use `mdbook-linkcheck` to validate URLs included in our documentation. `linkcheck` will be run automatically when you build with the instructions in the section above. +> [!NOTE] +> The link validation can be skipped by setting the following environment variable: +> `SKIP_LINKCHECK=1 mdbook ...` + ### Table of Contents We use `mdbook-toc` to auto-generate TOCs for long sections. You can invoke the preprocessor by @@ -66,9 +70,10 @@ including the `` marker at the place where you want the TOC. ## How to fix toolstate failures -> **NOTE**: Currently, we do not track the rustc-dev-guide toolstate due to -[spurious failures](https://github.com/rust-lang/rust/pull/71731), -but we leave these instructions for when we do it again in the future. +> [!NOTE] +> Currently, we do not track the rustc-dev-guide toolstate due to +> [spurious failures](https://github.com/rust-lang/rust/pull/71731), +> but we leave these instructions for when we do it again in the future. 1. You will get a ping from the toolstate commit. e.g. https://github.com/rust-lang-nursery/rust-toolstate/commit/8ffa0e4c30ac9ba8546b7046e5c4ccc2b96ebdd4 diff --git a/ci/linkcheck.sh b/ci/linkcheck.sh index 133e222397..b0e034b10b 100755 --- a/ci/linkcheck.sh +++ b/ci/linkcheck.sh @@ -7,6 +7,11 @@ set_github_token() { jq '.config.output.linkcheck."http-headers"."github\\.com" = ["Authorization: Bearer $GITHUB_TOKEN"]' } +if [ ! -z "$SKIP_LINKCHECK" ] ; then + echo "Skipping link check." + exec mdbook-linkcheck -f "" +fi + # https://docs.github.com/en/actions/reference/environment-variables if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job FLAGS=""