File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed
Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Security vulnerability scan"
2+ inputs :
3+ path :
4+ description : Path to scan
5+ required : false
6+ default : " ."
7+
8+ runs :
9+ using : composite
10+ steps :
11+ - name : Scan
12+ id : scan
13+ shell : bash
14+ run : |
15+ SOURCE_PATH="$(cd "${{ inputs.path }}" > /dev/null && pwd)"
16+ docker run --rm \
17+ --volume "${SOURCE_PATH}/:/src" \
18+ ghcr.io/google/osv-scanner:latest \
19+ scan \
20+ --lockfile=/src/go.mod \
21+ --format=markdown > osv-scanner.md
22+ - name : Report failure
23+ if : ${{ failure() && steps.scan.conclusion == 'failure' }}
24+ shell : bash
25+ run : |
26+ cat osv-scanner.md >> ${GITHUB_STEP_SUMMARY}
Original file line number Diff line number Diff line change 1+ name : " Security vulnerability scan"
2+
3+ on :
4+ schedule :
5+ - cron : " 22 22 * * *"
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : read
10+
11+ jobs :
12+ dev :
13+ name : Scan development codebase
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+ - uses : ./.github/actions/scan
18+
19+ release :
20+ name : Scan latest release
21+ runs-on : ubuntu-latest
22+ steps :
23+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+ with :
25+ sparse-checkout : |
26+ .github
27+ - name : Get latest releast tag
28+ id : latest-release
29+ run : echo "TAG=$(curl --location --silent --fail "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq --raw-output '.tag_name')" >> "${GITHUB_OUTPUT}"
30+ - name : Checkout release ${{ steps.latest-release.outputs.TAG }}
31+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+ with :
33+ ref : ${{ steps.latest-release.outputs.TAG }}
34+ path : src
35+ - uses : ./.github/actions/scan
36+ with :
37+ path : src
Original file line number Diff line number Diff line change @@ -242,3 +242,11 @@ dist-clean:
242242 -@rm -rf release/linux-arm64/hyperledger-fabric-ca-linux-arm64-$(RELEASE_VERSION ) .tar.gz || :
243243
244244.FORCE :
245+
246+ .PHONY : install-osv-scanner
247+ install-osv-scanner :
248+ go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest
249+
250+ .PHONY : scan
251+ scan : install-osv-scanner
252+ osv-scanner scan --lockfile=go.mod
You can’t perform that action at this time.
0 commit comments