-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test: add OSSF Scorecard #5405
base: next
Are you sure you want to change the base?
test: add OSSF Scorecard #5405
Conversation
WalkthroughThe pull request introduces a new GitHub Actions workflow file designed to perform supply-chain security analysis using the Scorecard tool. The workflow triggers on branch protection events, pushes to the "next" and "master" branches, and via a cron schedule every Monday at 18:37 UTC. It checks out the code, executes the analysis, uploads artifacts, and optionally publishes the results to GitHub’s code scanning dashboard, with specific permission and retention configurations. Changes
Sequence Diagram(s)sequenceDiagram
participant E as Event Trigger (branch, push, cron)
participant W as Workflow Runner (Ubuntu)
participant C as Code Checkout
participant S as Scorecard Analysis
participant A as Artifact Uploader
participant P as Scanning Publisher
E->>W: Trigger workflow
W->>C: Checkout repository
W->>S: Run Scorecard analysis
S->>A: Generate SARIF report and upload
A->>W: Confirm upload
alt Publish Enabled
S->>P: Publish results to code scanning dashboard
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (15)
🔇 Additional comments (10)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/scorecard.yml (3)
1-4
: Third-Party Actions Disclaimer
The disclaimer clearly informs users about the use of non-certified third-party actions and directs them to separate terms, privacy, and support documentation. Ensure that the referenced policies stay updated as the third-party services evolve.
17-18
: Default Permissions Setting
The default permissions are set toread-all
. While this may be intended to enforce a read-only policy, please double-check that this value produces the desired effect since GitHub Actions typically useread
for read-only access.
39-49
: Scorecard Analysis Step Examination
The analysis step is well configured to generate a SARIF-formatted results file using a pinned version of the Scorecard action. Consider uncommenting and configuring therepo_token
parameter when authentication enhancements are needed (e.g., for a private repository or public repositories requiring an authenticated branch-protection check).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/scorecard.yml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
- GitHub Check: Node.js / Test (windows-latest, 18)
- GitHub Check: Node.js / Test (ubuntu-latest, 18)
- GitHub Check: Node.js / Test (ubuntu-latest, 20)
- GitHub Check: Node.js / Test (windows-latest, 22)
- GitHub Check: Node.js / Test (windows-latest, 20)
- GitHub Check: Node.js / Test (windows-latest, 18)
- GitHub Check: Node.js / Test (ubuntu-latest, 22)
- GitHub Check: Node.js / Test (macos-latest, 22)
- GitHub Check: Node.js / Test (ubuntu-latest, 20)
- GitHub Check: Node.js / Test (ubuntu-latest, 20)
- GitHub Check: Node.js / Test (windows-latest, 20)
- GitHub Check: Node.js / Test (ubuntu-latest, 18)
- GitHub Check: Node.js / Test (macos-latest, 20)
- GitHub Check: Node.js / Test (macos-latest, 18)
- GitHub Check: Node.js / Test (ubuntu-latest, 22)
- GitHub Check: Node.js / Test (windows-latest, 22)
- GitHub Check: Node.js / Test (windows-latest, 18)
- GitHub Check: Node.js / Test (windows-latest, 20)
- GitHub Check: Node.js / Test (ubuntu-latest, 20)
- GitHub Check: Node.js / Test (ubuntu-latest, 18)
🔇 Additional comments (5)
.github/workflows/scorecard.yml (5)
5-16
: Workflow Trigger Configuration
The workflow is configured to trigger on branch protection events, a weekly schedule (cron), and pushes to the "next" and "master" branches. Please verify that thebranch_protection_rule
event is supported and that its configuration meets your repository’s requirements.
20-32
: Job-Level Permissions Configuration
The job-level permissions (i.e.,security-events: write
andid-token: write
) are specified correctly, and the commented lines provide useful guidance for private repositories. This configuration appears sound.
33-38
: Checkout Step Configuration
The checkout step uses a pinned commit foractions/checkout
and disables credential persistence, which is aligned with security best practices.
59-67
: Artifact Upload Configuration
The step to upload the SARIF file as an artifact (with a retention of 5 days) is correctly configured. Confirm that the retention period aligns with your artifact storage policies.
68-73
: Code Scanning Upload Step
The configuration for uploading the SARIF report to GitHub's code scanning dashboard using the CodeQL action is appropriate. Ensure that the SARIF report generated by the earlier steps conforms to GitHub’s expected format for seamless integration into the dashboard.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #5405 +/- ##
=======================================
Coverage 94.91% 94.91%
=======================================
Files 40 40
Lines 3774 3774
Branches 352 352
=======================================
Hits 3582 3582
Misses 192 192 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit