Replies: 1 comment
-
I adapted their docs to check for
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Vercel community! 👋
I have a project hosted on the platform, but I'd only like builds to be triggered for a specific branch. I read about the "Ignored Build Step" option, as well as the relevant KB article and previous discussions, but I can't quite figure it out.
My mission: Have my project only trigger builds for the
staging
branch.Attempt 1: Set the ignored build step to
echo $VERCEL_GIT_COMMIT_REF | grep --quiet staging && exit 1 || exit 0
. This works in my shell, but when Vercel runs it, the build is cancelled with the following output:Attempt 2: Set the ignored build step to
bash -c 'if [[ "$VERCEL_GIT_COMMIT_REF" == "staging" ]] ; then exit 1; else exit 0; fi
. Again, this works in my shell, but when Vercel runs it, the result is a syntax error.I made sure the "Automatically expose System Environment Variables" option was turned on and I also tried adding a system environment variable that pointed to the
VERCEL_GIT_COMMIT_REF
variable. None of these worked.How can I configure my project to only build the
staging
branch?Beta Was this translation helpful? Give feedback.
All reactions