about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/ci
diff options
context:
space:
mode:
authorMartin Liška <martin.liska@hey.com>2024-12-29 22:23:49 +0100
committerGitHub <noreply@github.com>2024-12-29 13:23:49 -0800
commita4e98268bbe8eb3dd0ad3fac7ea05156de74bd56 (patch)
tree7b438e728565ceed1d5b4154d436c8c51ca76577 /src/doc/rustc-dev-guide/ci
parentbb3f3d8efdcf216b0c0eaecd31ad21e803483a2a (diff)
downloadrust-a4e98268bbe8eb3dd0ad3fac7ea05156de74bd56.tar.gz
rust-a4e98268bbe8eb3dd0ad3fac7ea05156de74bd56.zip
Remove properly tracked config file from .gitignore & add support for skipping of link-checking (#2023)
* Remove properly tracked config file from .gitignore

The file is part of the git history and is a configuration file.

Fixes: #2018

* Add  env. variable support

* Refactoring

* Really skip linkcheck if requested
Diffstat (limited to 'src/doc/rustc-dev-guide/ci')
-rwxr-xr-xsrc/doc/rustc-dev-guide/ci/linkcheck.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/doc/rustc-dev-guide/ci/linkcheck.sh b/src/doc/rustc-dev-guide/ci/linkcheck.sh
index b3d8a444402..9b06f67fc9f 100755
--- a/src/doc/rustc-dev-guide/ci/linkcheck.sh
+++ b/src/doc/rustc-dev-guide/ci/linkcheck.sh
@@ -3,10 +3,17 @@
 set -e
 set -o pipefail
 
+LINKCHECK_BINARY=mdbook-linkcheck2
+
 set_github_token() {
   jq '.config.output.linkcheck."http-headers"."github\\.com" = ["Authorization: Bearer $GITHUB_TOKEN"]'
 }
 
+if [ ! -z "$SKIP_LINKCHECK" ] ; then
+  echo "Skipping link check."
+  exit 0
+fi
+
 # https://docs.github.com/en/actions/reference/environment-variables
 if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job
   FLAGS=""
@@ -32,10 +39,10 @@ else # running locally
   echo "Checking files changed in $COMMIT_RANGE: $CHANGED_FILES"
 fi
 
-echo "exec mdbook-linkcheck2 $FLAGS"
+echo "exec $LINKCHECK_BINARY $FLAGS"
 if [ "$USE_TOKEN" = 1 ]; then
   config=$(set_github_token)
-  exec mdbook-linkcheck2 $FLAGS <<<"$config"
+  exec $LINKCHECK_BINARY $FLAGS <<<"$config"
 else
-  exec mdbook-linkcheck2 $FLAGS
+  exec $LINKCHECK_BINARY $FLAGS
 fi