We have a use case where we would like to execute some custom actions when the "Merge" button is pushed in the Stash user interface. The end-goal is to update a version number that we can use in our gradle build scripts to be stamped in any builds done in our code.
Outside of Stash, we currently achieve this with pre-commit hooks, that modify our version number in a properties file. We have also tested and are considering using git tags instead. However, now that we've moved to stash. The "Merge" is handled outside of our local repos and thus our git hooks do not run. So I'm looking for some guidance. In Stash,
- Is there a way (either via a hook) to tag a specific commit at merge time? I didn't find anything conclusive that suggested this was possible.
- It seems it should be possible to write a hook that will modify a properties file, and ammend the commit. The thing about this solution that I'm not clear on is how/where the merge itself gets executed... The SDK exposes actions like git add and git commit, but are they run on the origin server itself? or elsewhere?
I hope my questions are clear! Thanks!