Here's the current flow. It starts when math's develop branch is changed.
0. (Local) Checkout stan-dev/stan and update to develop. Change directories into that directory.
1. (Local) Check to see if the math branch has actually changed. If not, don't do anything.
2. (GitHub) Create a github issue with title "Update submodule for the Stan Math Library". Save the issue number.
3. (Local) Create a new feature branch named feature/issue-#-update-math where # is the issue number.
4. (Local) Update the math submodule to develop. Stage the change to the submodule. Commit. Push to the remote.
5. (GitHub) Create a pull request with the feature branch.
What would be ideal is a check to see if an issue exists with the title "Update submodule for the Stan Math Library" it would then update the existing feature branch. No need to create a new pull request. Perhaps a new comment.
Help? I tried doing it, but I'm not that great at scripting.
Daniel