Trigger branch deploy from build hook where branch contains a slash /

Hi,

I’d like to trigger a branch deploy using a build hook with a trigger_branch containing a / but I haven’t been able to successfully run a build so far. I’m using curl and have tried several things like url encoding but it seems Netlify always already encodes the branch name but not decodes it so it never works. Could you advise on how to do this?

CURL command:
curl --location --request POST 'https://api.netlify.com/build_hooks/<hash>?trigger_branch=feature/test-ci&trigger_title=Branch%20test%20deploy'

Results in:

12:42:26 PM: git ref refs/heads/feature&#x2F;test-ci does not exist or you do not have permission
12:42:26 PM: Failing build: Failed to prepare repo
12:42:26 PM: failed during stage 'preparing repo': git ref refs/heads/feature&#x2F;test-ci does not exist 

Any help is appreciated.

1 Like

Thanks for posting and sorry you’re running into this. This is an issue that’s on our radar and we plan to fix it, although unfortunately can’t provide a timeline. Is there any possibility of renaming your build hook so that it doesn’t include a ‘/’?

Hi jen, thank you for your quick response. Nice to hear this is already on your radar. Unfortunately renaming is not an option for us at this point. Would love to know when there are any updates.

Hi, @floris10hove. The feature request and this community topic are cross-linked for tracking.

If/when using a forward slash in build hook triggers becomes possible, we’ll update this topic to let you now about it.

1 Like