-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* ci: added logic for backport PRs * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * ci: fixed backport yaml issue * docs: updated README with Netlify steps (cherry picked from commit 913a118) Co-authored-by: Karl Cardenas <karl@spectrocloud.com>
- Loading branch information
1 parent
6b8a0d1
commit 8eab44f
Showing
7 changed files
with
79 additions
and
8 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[build] | ||
ignore = "./scripts/netlify.sh" | ||
command = "npm run build" | ||
|
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,33 @@ | ||
#!/bin/bash | ||
|
||
# List of branches to NOT create a Netlify preview | ||
# Master branch does not need a preview | ||
# Release branches get a preview through docs-latest.spectrocloud.com | ||
allowed_branches=("master" "release-*") | ||
|
||
echo "Branch name: $HEAD" | ||
|
||
# Read the environment variable | ||
branch_name=$HEAD | ||
|
||
# Initialize a flag to check if the branch is not allowed | ||
not_allowed=0 | ||
|
||
# Compare $HEAD against the list | ||
for allowed in "${allowed_branches[@]}" | ||
do | ||
# Use double brackets and == for pattern matching | ||
if [[ "$branch_name" == $allowed ]]; then | ||
not_allowed=1 | ||
break | ||
fi | ||
done | ||
|
||
# Exit accordingly | ||
if [ $not_allowed -eq 1 ]; then | ||
echo "Not allowed to create a Netlify preview" | ||
exit 0 | ||
else | ||
echo "Allowed to create a Netlify preview" | ||
exit 1 | ||
fi |