forked from kubernetes/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add _headers file checking logic (kubernetes#9879)
* Add _headers file checking logic * Remove netlify_noindex_headers.txt file
- Loading branch information
1 parent
7360a0c
commit b6bb3a6
Showing
5 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |