# Git sha compare
### Idea
When committing to a branch, then compare the original master commit of the branch.
When committing to master, then compare to the previous master commit.
### Environment variables
`CURRENT_SHA = <Codebuild will provide this>`
`CURRENT_BRANCH = <Codebuild will provide this>`
`ACTUAL_IMAGES_SHA = CURRENT_SHA`
`EXPECTED_IMAGES_SHA`
### Logic:
```
if (CURRENT_BRANCH == 'origin/dev') {
// Set the expected sha to the last master commit
EXPECTED_IMAGES_SH