I want to create my script on github and pull it to NodeRed ... Will it work?

I created a test script on Github and want to pull that script on to nodered .... I know the vice-versa is possible i.e. pulling the script from local machine to NodeRed and then committing the changes to Github.

What do you mean by a script in this case? What do you want to do with it in node-red?

Its just a python script to add 2 numbers that is in my github repo. I want to import it to NodeRed interface as a block and then feed-in time triggered inputs

Are you going to call it via an exec node? That is generally considered the best way to run python scripts from node-red. If so then the script itself is nothing directly to do with node-red, you can fetch it from github to anywhere on the machine and then run it from node-red by specifying the full path.

Can't I pull my script from Github to NodeRed interface directly? Instead of pulling it from github to local machine and then importing it to a NodeRed project

It isn't imported into node-red at all, you just invoke it from an exec node. So you could pull your github file to /home/me/bin for example and then in node-red configure the exec node to run /home/me/bin/myscript.py

Can we configure nodered in such a way that it automatically pulls my script from github and save it on to my local machine and then automatically run exec node ?

Well you could use an exec node to call curl to grab the file then pipe that into bash (or cmd) to execute it and return the result.

wow that's great .... Is there any material that I could refer to sir ?

LMGTFY https://stackoverflow.com/questions/5735666/execute-bash-script-from-url

1 Like

Thank you sir ... Appreciate the help @dceejay n @Colin


I :heart: LMGTFY

for anyone wondering see here

A bit harsh!
It's easy to google solutions when you have the knowledge to ask the right question, and interpret the correct answer....

Actually this may be a better link https://www.baeldung.com/linux/execute-bash-script-from-url

@ComboKnight, note that this will fail if you haven't got an internet connection when you try to run it. Also it will download it every time you run the command.
If that is a problem then you will have to download it in advance.

ohh alright @Colin I am trying that out

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.