It's common that Gulp handles all the assets like CSS and JS. At the moment gulp is run when $SCSS_CHANGED is true in post-receive hook.
It would make sense that by default it would catch changes on JS files also. Maybe it can be called ASSETS_CHANGED instead of SCSS_CHANGED.
And then something like:
ASSETS_CHANGED=false
elif [[ "$line" =~ \.scss ]] || [[ "$line" =~ \.js ]]
then
ASSETS_CHANGED=true
I'm also not certain should there be npm install before gulp, haven't tested this yet.