From b03f1015e1dfdd0ad4d2ba964f07e18d19951c0b Mon Sep 17 00:00:00 2001 From: Andre Nogueira Date: Thu, 26 Nov 2026 22:57:27 +0000 Subject: [PATCH] fix(ci): allow Go patent grant license in dependency-review and print Trivy CVEs Allow LicenseRef-scancode-google-patent-license-golang (used by golang.org/x/* packages alongside BSD-3-Clause) and standard public-domain/permissive SPDX IDs in dependency-review.yml, add an MIT LICENSE to techquestsdev/.github, and surface Trivy SARIF findings as explicit ::error:: annotations in go-ci.yml. Signed-off-by: Andre Nogueira --- .github/workflows/dependency-review.yml | 2 +- .github/workflows/go-ci.yml | 15 ++++++++++++++- LICENSE | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 050bb39..7a4bdd6 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -12,7 +12,7 @@ on: description: "Comma-separated list of SPDX license identifiers allowed in dependencies" required: false type: string - default: "MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, MPL-2.0" + default: "MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, MPL-2.0, Unlicense, CC0-1.0, Zlib, BlueOak-1.0.0, PSF-2.0, LicenseRef-scancode-google-patent-license-golang" permissions: contents: read diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 35f2836..d5a59be 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -152,7 +152,7 @@ jobs: format: "sarif" output: "trivy-results.sarif" severity: ${{ inputs.trivy-severity }} - exit-code: ${{ inputs.trivy-exit-code }} + exit-code: "0" - name: Upload Trivy results to GitHub Security tab if: always() @@ -160,6 +160,19 @@ jobs: with: sarif_file: "trivy-results.sarif" + - name: Check Trivy findings + if: inputs.trivy-exit-code != '0' + env: + TRIVY_EXIT_CODE: ${{ inputs.trivy-exit-code }} + run: | + set -euo pipefail + count=$(jq '[.runs[].results[]?] | length' trivy-results.sarif) + if [ "$count" -gt 0 ]; then + jq -r '.runs[].results[]? | "::error title=\(.ruleId)::\(.message.text | gsub("\n"; " | "))"' trivy-results.sarif + echo "Found ${count} vulnerability finding(s)" + exit "$TRIVY_EXIT_CODE" + fi + build: name: Build (${{ matrix.os }}) needs: [test, lint, security] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5e6923d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 André Nogueira + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.