I’ve encountered a few github repos that are using “MASTER” as the default branch instead of “MAIN”. How can we setup the agent to do something like an “OR” statement? Where would we define that?
Thanks!
Jay
I’ve encountered a few github repos that are using “MASTER” as the default branch instead of “MAIN”. How can we setup the agent to do something like an “OR” statement? Where would we define that?
Thanks!
Jay
I will be showing how to do this later in the series but with Python and not n8n. In n8n, the best approach I can think of would be to first make a request to get the branches for the repo, see:
Then check the response there to see if there is a main or master branch. Use the “switch” node to route to the HTTP request for the main branch if main is found and master is nice, and handle the opposite in a similar fashion.
I hope that helps!
Awesome! Thanks, Cole! It’s a little over my head but I’m going to see if the n8n expert agent can help me get it squared away. Looking forward to the series! Jay