Add _headers file checking logic (#9879)
* Add _headers file checking logic * Remove netlify_noindex_headers.txt file
This commit is contained in:
committed by
k8s-ci-robot
parent
7360a0c10c
commit
b6bb3a60a0
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$HUGO_ENV" == "production" ]; then
|
||||
echo "INFO: Production environment. Checking the _headers file for noindex headers."
|
||||
|
||||
if grep -q "noindex" public/_headers; then
|
||||
echo "PANIC: noindex headers were found in the _headers file. This build has failed."
|
||||
exit 1
|
||||
else
|
||||
echo "INFO: noindex headers were not found in the _headers file. All clear."
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "Non-production environment. Skipping the _headers file check."
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user