
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
serverless-plugin-git-variables
Advanced tools
Serverless plugin to expose git status to serverless services
Expose git variables (HEAD description, branch name, short commit hash, message, git tags, and if the local repo has changed files) to your serverless services. Moreover, it adds GIT related environment variables and tags (GIT_COMMIT_SHORT, GIT_COMMIT_LONG, GIT_BRANCH, GIT_IS_DIRTY, GIT_REPOSITORY, GIT_TAGS) for each defined function in the serverless file. You can disable this by adding the following custom variable in your serverless.yml file:
custom:
exportGitVariables: false
If you only want to add a specific subset of variables/tags, you can define a whitelist:
custom:
gitVariablesEnvWhitelist: ['GIT_COMMIT_SHORT', 'GIT_TAGS']
gitVariablesTagsWhitelist: ['GIT_REPOSITORY', 'GIT_COMMIT_LONG']
If you have multiple git tags, you'll run into issues when adding them as AWS tags, so you'll need to exclude them from the whitelist.
custom:
gitDescription: ${git:repository} - ${git:branch} - ${git:tags}
functions:
processEventBatch:
name: ${self:provider.stage}-${self:service}-process-event-batch
description: ${self:custom.gitDescription}
processEventBatch2:
name: ${self:provider.stage}-${self:service}-process-event-batch-2
description: ${self:custom.gitDescription}
plugins:
- serverless-plugin-git-variables
resources:
Description: >
${self:service} ${git:branch}:${git:sha1}
https://github.com/jacob-meacham/serverless-plugin-git-variables
${git:message}
The describe (${git:describe}) and the describeLight (${git:describeLight}) variables are both used to return the most recent tag of the repo. However the difference is that whilst describe evaluates to git describe --always, the describeLight variable evaluates to git describe --always --tags.
--always will ensure that if no tags are present, the commit hash is shown as a fallback option. (See git describe documentation for more information).
Annotated tags are shown by both describe and describeLight, only describeLight will show lightweight tags (such as those generated when using GitHub's releases feature).
For more information on annotated and lightweight tags go to the git documentation on tagging.
The tags (${git:tags}) is used to get info about which git tags (separated by ::) are pointing to current commit and if none it will show commit ID as fallback.
tags separator from ',' to '::' to conform to the AWS tag regexFAQs
Serverless plugin to expose git status to serverless services
The npm package serverless-plugin-git-variables receives a total of 13,727 weekly downloads. As such, serverless-plugin-git-variables popularity was classified as popular.
We found that serverless-plugin-git-variables demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.