serverless-git-info

Exposes git information extracted from the current local repository as Serverless variables.
Similar to serverless-plugin-git-variables, but without exporting as environment variables and without a dependency on babel-runtime.
Installation
npm install serverless-git-info --save-dev
Usage
Add the following to your serverless.yml
:
plugins:
- serverless-git-info
custom:
gitBranch: ${git:branch}
gitCommit: ${git:commit}
gitSha1: ${git:sha1}
gitUser: ${git:user.name}
gitEmail: ${git:user.email}
gitInfo: ${git:branch}@${git:sha1}
When you need to expose git info to your Lambda functions:
plugins:
- serverless-git-info
provider:
name: aws
environment:
GIT_COMMIT: ${git:commit}
functions:
test:
environment:
GIT_BRANCH: ${git:branch}
This plugin does not have any configuration options (yet).