Skip to content

Commit

Permalink
Remove scan dependencies git hook (#132)
Browse files Browse the repository at this point in the history
## Description

There is not much benefit in running a potentially outdated CVE check
locally, especially considering that the GitHub Action always performs a
check against the latest version.

- Fixes #128 

## Context

Grype [updates its
database](https://github.com/anchore/grype#data-staleness) at the first
run or every 5 days. The size is approximately 1GB. It may take minutes
for the scan dependencies git hook to complete. This is not a good user
experience.

## Type of changes

- [x] Refactoring (non-breaking change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would change existing
functionality)
- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I am familiar with the [contributing
guidelines](../docs/CONTRIBUTING.md)
- [x] I have followed the code style of the project
- [ ] I have added tests to cover my changes
- [x] I have updated the documentation accordingly
- [ ] This PR is a result of pair or mob programming

---

## Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others
privacy, we kindly ask you to NOT including [PII (Personal Identifiable
Information) / PID (Personal Identifiable
Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public)
or any other sensitive data in this PR (Pull Request) and the codebase
changes. We will remove any PR that do contain any sensitive
information. We really appreciate your cooperation in this matter.

- [x] I confirm that neither PII/PID nor sensitive data are included in
this PR and the codebase changes.
  • Loading branch information
stefaniuk authored Sep 21, 2023
1 parent 7f19931 commit 2ba6d0d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
1 change: 0 additions & 1 deletion docs/user-guides/Run_Git_hooks_on_commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The [pre-commit](https://pre-commit.com/) framework is a powerful tool for manag
- [check-file-format.sh](../../scripts/githooks/check-file-format.sh)
- [check-markdown-format.sh](../../scripts/githooks/check-markdown-format.sh)
- [check-terraform-format.sh](../../scripts/githooks/check-terraform-format.sh)
- [scan-dependencies.sh](../../scripts/githooks/scan-dependencies.sh)
- [scan-secrets.sh](../../scripts/githooks/scan-secrets.sh)
- Configuration
- [pre-commit.yaml](../../scripts/config/pre-commit.yaml)
Expand Down
1 change: 0 additions & 1 deletion docs/user-guides/Scan_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ In modern software development, leveraging third-party dependencies is a common
- [grype.yaml](../../scripts/config/grype.yaml): A configuration file for the CVE scanner
- [scan-dependencies/action.yaml](../../.github/actions/scan-dependencies/action.yaml): GitHub action to run the scripts as part of the CI/CD pipeline
- [.gitignore](../../.gitignore): Excludes the `*sbom*report.json` and `*vulnerabilities*report.json` report files created during the process
- [scan-dependencies.sh](../../scripts/githooks/scan-dependencies.sh): a Git hook to scan dependencies upon each commit. For a more comprehensive information of how these Git hooks operate, please refer to the [Run Git hooks on commit](./Run_Git_hooks_on_commit.md) guide

## Configuration checklist

Expand Down
7 changes: 0 additions & 7 deletions scripts/config/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,3 @@ repos:
entry: ./scripts/githooks/check-terraform-format.sh
language: script
pass_filenames: false
- repo: local
hooks:
- id: scan-dependencies
name: Scan Dependencies
entry: ./scripts/githooks/scan-dependencies.sh
language: script
pass_filenames: false
37 changes: 0 additions & 37 deletions scripts/githooks/scan-dependencies.sh

This file was deleted.

0 comments on commit 2ba6d0d

Please sign in to comment.