Since the latest Trivy release, you can now scan not just your git repository for vulnerabilities but also specify the branch, the git commit hash, or the tag that you want to specify.
BIG Shout-out to Shubham, who contributed the feature to Trivy.
Resources 📚
You can find the repository here: https://github.com/aquasecurity/trivy
The Trivy Documentation: https://aquasecurity.github.io/trivy/latest/docs/vulnerability/scanning/git-repository/
Installing Trivy: https://aquasecurity.github.io/trivy/v0.31.2/getting-started/installation/
Make sure to join our Slack community: https://slack.aquasec.com
⭐Give our projects a star on GitHub⭐
https://github.com/aquasecurity/trivy