Skip to content

chore: update OSV-Scanner to v2.0.2 #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ indent_size = 2

[.gitmodules]
indent_style = tab

[Makefile]
indent_style = tab
4 changes: 1 addition & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ jobs:
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Create Gradle lockfile
run: ./gradlew :${{ matrix.project }}:dependencies --write-locks
- name: Scan
run: docker run --rm -v "${PWD}/${{ matrix.project }}/gradle.lockfile:/gradle.lockfile" ghcr.io/google/osv-scanner:v2.0.0 scan --lockfile /gradle.lockfile
run: make component=${{ matrix.project }} scan
java:
name: Build and Test Java
runs-on: ubuntu-latest
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# SPDX-License-Identifier: Apache-2.0
#

OSV_SCANNER_IMAGE := ghcr.io/google/osv-scanner:v2.0.2

.PHONY: scan
scan:
ifdef component
./gradlew --quiet ':$(component):dependencies' --write-locks --configuration runtimeClasspath
docker run --rm --volume './$(component)/gradle.lockfile:/gradle.lockfile' $(OSV_SCANNER_IMAGE) scan --lockfile /gradle.lockfile
else
$(MAKE) component=core scan
$(MAKE) component=isthmus scan
$(MAKE) component=isthmus-cli scan
endif

.PHONY: clean
clean:
find . -depth 2 -type f -name gradle.lockfile -delete -print
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like using Makefiles for stuff like this 🔧

This makes me want to add (in the future) targets like make build, make test and make format to invoke Gradle as it makes it easier for new contributors to run the codebase for the first time. When we do that, I would also want to have make clean invoke ./gradlew clean. Would that cause any issues for your work here?

Copy link
Contributor Author

@bestbeforetoday bestbeforetoday May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at all. It sounds like a great idea to me. If you wanted to keep the Makefile targets more granular as it is extended, the clean target in this change could be renamed to scan-clean (or clean-scan), and the (new) clean target could depend on scan-clean.

Loading