-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,21 @@ description: | | |
The Mission Critical Vulnerability Scanner (MCVS) Golang action. | ||
inputs: | ||
code_coverage_expected: | ||
default: "80" | ||
description: | | ||
The minimum code coverage. | ||
default: "80" | ||
gci: | ||
default: "true" | ||
description: | | ||
Whether to check gci. Disable if the project provides an alternative way. | ||
golang-unit-tests-exclusions: | ||
default: " " | ||
description: | | ||
The Golang paths that should be excluded from unit testing. | ||
default: " " | ||
golangci-lint-version: | ||
default: v1.55.2 | ||
description: | | ||
The Golangci-lint version that has to be installed and used. | ||
default: v1.55.2 | ||
golang-number-of-tests-in-parallel: | ||
description: | | ||
Number of test in parallel. | ||
|
@@ -65,6 +69,7 @@ runs: | |
# but it does not provide clarity how to resolve it when positive. | ||
# | ||
- name: gci | ||
if: inputs.gci == 'true' | ||
shell: bash | ||
run: | | ||
go install github.com/daixiang0/[email protected] | ||
|
@@ -85,11 +90,17 @@ runs: | |
severity-cutoff: high | ||
- uses: 030/[email protected] | ||
- name: Log in to GitHub Packages Docker registry | ||
if: inputs.token != '' | ||
shell: bash | ||
run: | | ||
echo "${{ inputs.token }}" |\ | ||
docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
# | ||
# Duplicated trivy-action parameters as dependabot does NOT support | ||
# anchors: https://github.com/actions/runner/issues/1182 | ||
# | ||
- uses: aquasecurity/[email protected] | ||
if: inputs.token != '' | ||
env: | ||
TRIVY_DB_REPOSITORY: ${{ inputs.trivy-action-db }} | ||
TRIVY_JAVA_DB_REPOSITORY: ${{ inputs.trivy-action-java-db }} | ||
|
@@ -102,6 +113,18 @@ runs: | |
ignore-unfixed: true | ||
severity: "CRITICAL,HIGH" | ||
trivyignores: .trivyignore | ||
- uses: aquasecurity/[email protected] | ||
if: inputs.token == '' | ||
env: | ||
TRIVY_DB_REPOSITORY: ${{ inputs.trivy-action-db }} | ||
TRIVY_JAVA_DB_REPOSITORY: ${{ inputs.trivy-action-java-db }} | ||
with: | ||
scan-type: "fs" | ||
scan-ref: "." | ||
exit-code: "1" | ||
ignore-unfixed: true | ||
severity: "CRITICAL,HIGH" | ||
trivyignores: .trivyignore | ||
# | ||
# Run golangci-lint. | ||
# | ||
|