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

**URL:** <https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232>\
**Category:** General\
**Created:** [2 November 2020 18:34 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232 "2020-11-02T18:34:55Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [2 November 2020 18:34 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/1 "2020-11-02T18:34:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 November 2020 21:35 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/2 "2020-11-02T21:35:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [3 November 2020 18:33 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/3 "2020-11-03T18:33:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 November 2020 21:28 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/4 "2020-11-03T21:28:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [3 November 2020 21:48 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/5 "2020-11-03T21:48:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [3 November 2020 22:04 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/6 "2020-11-03T22:04:55Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [3 November 2020 22:27 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/7 "2020-11-03T22:27:23Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 November 2020 22:30 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/8 "2020-11-03T22:30:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [3 November 2020 22:33 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/9 "2020-11-03T22:33:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 November 2020 22:46 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/10 "2020-11-03T22:46:00Z")

</div>

LMGTFY [https://stackoverflow.com/questions/5735666/execute-bash-script-from-url](https://stackoverflow.com/questions/5735666/execute-bash-script-from-url)

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [3 November 2020 22:48 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/11 "2020-11-03T22:48:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 November 2020 23:15 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/12 "2020-11-03T23:15:02Z")

</div>

> [@dceejay](#):
>
> LMGTFY

😆

I ❤ LMGTFY

for anyone wondering [see here](https://bit.ly/3evIks4)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 November 2020 23:32 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/13 "2020-11-03T23:32:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 November 2020 23:39 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/14 "2020-11-03T23:39:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 November 2020 08:54 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/15 "2020-11-04T08:54:07Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ComboKnight](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@ComboKnight](https://discourse.nodered.org/u/ComboKnight)\
**Post date:** [4 November 2020 23:07 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/16 "2020-11-04T23:07:18Z")

</div>

ohh alright @Colin I am trying that out

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 November 2020 23:07 UTC](https://discourse.nodered.org/t/i-want-to-create-my-script-on-github-and-pull-it-to-nodered-will-it-work/35232/17 "2020-11-18T23:07:27Z")

</div>

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