docs/sf/guides/variables/git.md
You can leverage Git-related information in your serverless.yml configuration using Git variables. This allows you to include dynamic data related to your Git environment directly into your deployment configuration.
describe but only considers lightweight (non-annotated) tags.To reference Git variables, use the ${git:<variable>} syntax in your serverless.yml.
Here's how you might use these variables:
service: new-service
functions:
hello:
name: hello-${git:branch}
handler: handler.hello
description: ${git:message}
In the above configuration, the service and function names will dynamically include the branch name, and the function description will include the commit message.