Skip to content

Commit 3c8f252

Browse files
author
markzegarelli
authored
Merge pull request #1591 from segmentio/netlify-toml-update
netlify toml update
2 parents 1460e21 + d9b86ed commit 3c8f252

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[context.deploy-preview]
88
command = "yarn develop"
9-
ignore = "git log -1 --pretty=%B | ( grep -q '\\[netlify\\-ignore\\]' )"
9+
ignore = "./scripts/ignore.sh"
1010

1111
[[redirects]]
1212
from = "/docs/*"

scripts/ignore.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# grab the latest entry from git log
4+
log=$(env -i git log -1 --pretty=%B)
5+
6+
# run a series of checks for common reasons that we shouldn't preview build.
7+
# if no checks match, exit with code 1 to run the build
8+
9+
# ignore for simple typo fixes
10+
if echo "$log" | grep -q 'typo'; then
11+
exit
12+
# ignore link / url updates
13+
elif echo "$log" | grep -q 'link'; then
14+
exit
15+
# ignore when the ignore tag is explicitly added
16+
elif echo "$log" | grep -q 'netlify\-ignore'; then
17+
exit
18+
# ignore dependabot updates
19+
elif echo "$log" | grep -q 'dependabot'; then
20+
exit
21+
# ignore when master is merged into a branch
22+
elif echo "$log" | grep -q 'Merge branch \SMaster\S'; then
23+
exit
24+
else
25+
exit 1
26+
fi
27+

0 commit comments

Comments
 (0)