Can't you run the command you need in a deployment hook and do whatever you need to do after that?
What I do is save the branch/tag in a file during deployment. This way it can simply read the file instead of asking git everytime what the status is.
You can do this with envoyer's variables available during deployment:
-
{{ branch }}= current branch or tag name, this one is not listed in the documentation. -
{{ sha }}= commit hash - More > https://envoyer.io/docs