A plugin for comparing local and deployed AWS serverless stack versions.
npm install serverless-git-version-compare

!Secured by: Jit

serverless-git-version-compare is a plugin for the Serverless Framework that compares the local and deployed AWS
serverless stack versions. It helps ensure that the same version is not deployed multiple times, preventing unnecessary
deployments.
sls deploy, the plugin will automatically compare the local and deployed versions by using the HEAD commit hash and comparing it to the stack tag.For local deployments, if the working directory is not clean, the deployment will continue regardless of the version comparison.
To change this default behavior, see the configuration section below.
To install the plugin, add it to your project using npm:
``bash`
npm install serverless-git-version-compare --save-dev`
Then, add the plugin to your serverless.yml file:yaml`
plugins:
- serverless-git-version-compare
yaml
custom:
gitVersionCompare:
enabled: true
alwaysDeployDirty: true
`
- enabled (default: true): Enables or disables the plugin.
- alwaysDeployDirty (default: true): Whether to ignore version comparison if the working directory is not clean.CLI Options
The plugin provides an optional CLI option:
`bash
--force: Forces the deployment to continue regardless of the commit hash.
`Plugin Commands
The plugin provides a command to fetch the current deployed version:
`text
sls get-deployed-commit
``