aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/netlify-ignore-command.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docs/netlify-ignore-command.sh')
-rwxr-xr-xdocs/netlify-ignore-command.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/netlify-ignore-command.sh b/docs/netlify-ignore-command.sh
new file mode 100755
index 0000000000..aaf4402220
--- /dev/null
+++ b/docs/netlify-ignore-command.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# We deploy main, version branches and deploy previews only
+if echo $HEAD | grep -E '^(main|v[[:digit:]]+\.([[:digit:]])+-branch)$' || echo $CONTEXT | grep '^deploy-preview$'
+then
+ echo "Head '$HEAD' matches a deployed branch, or context is deploy preview, checking for git changes."
+ git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../app/boards/
+else
+ echo "Head '$HEAD' does not match a deployed branch and is not a deploy preview"
+ exit 0
+fi \ No newline at end of file