Skip to content

Commit

Permalink
ci(Vercel): Add ignore-step.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
simonknittel authored Feb 3, 2024
1 parent 7b69e1c commit 727f40c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .vercel/ignore-step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Related: https://vercel.com/guides/how-do-i-use-the-ignored-build-step-field-on-vercel

echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF";

# Only proceed for main, develop, and feature branches
if [[ "$VERCEL_GIT_COMMIT_REF" != "main" && "$VERCEL_GIT_COMMIT_REF" != "develop" && "$VERCEL_GIT_COMMIT_REF" != feature/* ]] ; then
echo "🛑 - Build cancelled (Reason: Incorrect branch. We only deploy main, develop and fetures branches.)"
exit 0;
fi

# Only proceed when files in /app have changed
if [[ ! `git diff HEAD^ HEAD .` ]]; then
echo "🛑 - Build cancelled (Reason: No app changes.)"
exit 0;
fi

echo "✅ - Build can proceed"
exit 1;

0 comments on commit 727f40c

Please sign in to comment.