From a5d297c75f3f9c9e20c941240d1ebd6d16054b14 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 06:56:58 +0000 Subject: [PATCH 1/3] Add OpenSSF Scorecard workflow Runs weekly security analysis and uploads SARIF results to GitHub code scanning. Third-party actions are pinned by commit SHA. Adds the Scorecard badge to the README. Based on quickwit-oss/quickwit#5969. --- .github/workflows/scorecard.yml | 51 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 000000000..6f1c2247e --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,51 @@ +name: OpenSSF Scorecard + +on: + schedule: + - cron: '0 0 * * 0' + push: + branches: + - main + +permissions: + contents: read + +jobs: + analysis: + name: Scorecards analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results + id-token: write + actions: read + contents: read + + steps: + - name: 'Checkout code' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: 'Run analysis' + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + repo_token: ${{ secrets.GITHUB_TOKEN }} + publish_results: true + + # Upload the results as artifacts. + - name: 'Upload artifact' + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: 'Upload to code-scanning' + uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + with: + sarif_file: results.sarif diff --git a/README.md b/README.md index 36daca8a2..d8098a5e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Docs](https://docs.rs/tantivy/badge.svg)](https://docs.rs/crate/tantivy/) [![Build Status](https://github.com/quickwit-oss/tantivy/actions/workflows/test.yml/badge.svg)](https://github.com/quickwit-oss/tantivy/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/quickwit-oss/tantivy/branch/main/graph/badge.svg)](https://codecov.io/gh/quickwit-oss/tantivy) +[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/quickwit-oss/tantivy/badge)](https://scorecard.dev/viewer/?uri=github.com/quickwit-oss/tantivy) [![Join the chat at https://discord.gg/MT27AG5EVE](https://shields.io/discord/908281611840282624?label=chat%20on%20discord)](https://discord.gg/MT27AG5EVE) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Crates.io](https://img.shields.io/crates/v/tantivy.svg)](https://crates.io/crates/tantivy) From ff1433713a1158a60ab152ff3ac900e27000396d Mon Sep 17 00:00:00 2001 From: Oleksii Syniakov <1282756+osyniakov@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:07:45 +0200 Subject: [PATCH 2/3] bump upload-sarif -> 4.35.2 Co-authored-by: trinity-1686a --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6f1c2247e..97b62c347 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -46,6 +46,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10 + uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 with: sarif_file: results.sarif From f8f3e4277f71fb427c9e0dc30df0a137449c509e Mon Sep 17 00:00:00 2001 From: Oleksii Syniakov <1282756+osyniakov@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:09:30 +0200 Subject: [PATCH 3/3] remove not neeeded permissions for the public repo --- .github/workflows/scorecard.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 97b62c347..83793e57d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -19,8 +19,6 @@ jobs: security-events: write # Needed to publish results id-token: write - actions: read - contents: read steps: - name: 'Checkout code'