Skip to content

Test - #682

Closed
parag85 wants to merge 0 commit into
SasanLabs:masterfrom
parag85:master
Closed

Test #682
parag85 wants to merge 0 commit into
SasanLabs:masterfrom
parag85:master

Conversation

@parag85

@parag85 parag85 commented Jul 4, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Added automated code review on pull requests.
    • Added a command-driven assistant workflow for comments, reviews, and issues.
    • Added continuous security scanning with CodeQL and Semgrep.
  • Documentation
    • Updated a wording detail in the usage guide for cleaner phrasing.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds four new GitHub Actions workflows: Claude Code Review (PR-triggered automated review), Claude Code (comment-triggered interactive assistant), CodeQL (scheduled/PR security analysis), and Semgrep (static analysis with SARIF upload). A minor punctuation fix is also made to docs/Usage.md.

Changes

CI/CD Workflow Additions

Layer / File(s) Summary
Claude Code Review workflow
.github/workflows/claude-code-review.yml
New workflow triggers on PR open/sync/ready/reopen events and runs anthropics/claude-code-action@v1 to review the PR using an OAuth secret.
Claude Code interactive workflow
.github/workflows/claude.yml
New workflow triggers on comments/issues/reviews containing "@claude", checks out the repo, and runs the Claude Code action with additional permissions.
CodeQL analysis workflow
.github/workflows/codeql.yml
New workflow runs CodeQL analysis on push/PR to master and weekly schedule, using a language matrix and dynamic runner OS selection.
Semgrep analysis workflow
.github/workflows/semgrep.yml
New workflow runs Semgrep on push/PR to master and weekly schedule, then uploads generated SARIF results to GitHub security features.
Documentation punctuation fix
docs/Usage.md
Removes an extraneous comma in a sentence describing VulnerableApp's academic interest.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague and does not describe the workflow and docs changes in this pull request. Rename the PR to a concise summary of the main change, such as adding Claude, CodeQL, and Semgrep workflows.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.46%. Comparing base (b51f060) to head (2cc4444).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #682   +/-   ##
=========================================
  Coverage     54.46%   54.46%           
  Complexity      663      663           
=========================================
  Files            91       91           
  Lines          3604     3604           
  Branches        399      399           
=========================================
  Hits           1963     1963           
  Misses         1463     1463           
  Partials        178      178           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
.github/workflows/semgrep.yml (1)

46-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

upload-sarif@v3 vs v4 used in codeql.yml.

This PR pins github/codeql-action/upload-sarif to v3 here while codeql.yml in the same PR uses init@v4/analyze@v4. Consider aligning the major version across workflows to avoid divergent behavior/deprecation timelines for the shared codeql-action family.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/semgrep.yml at line 46, The semgrep workflow is pinning
github/codeql-action/upload-sarif to a different major version than the other
CodeQL workflow steps, so align the shared codeql-action version across
workflows. Update the upload-sarif step to match the v4 family used by
codeql.yml, and verify the surrounding CodeQL job configuration still references
the same action major version consistently.
.github/workflows/claude-code-review.yml (2)

29-32: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Set persist-credentials: false on checkout.

actions/checkout@v4 The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set persist-credentials: false to opt-out. Since this workflow only reads the repo for review (no push needed), any subsequent step or compromised third-party action could otherwise reuse the persisted token.

🔒 Proposed fix
       - name: Checkout repository
         uses: actions/checkout@v4
         with:
           fetch-depth: 1
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude-code-review.yml around lines 29 - 32, The Checkout
repository step in the workflow should opt out of persisting the auth token.
Update the actions/checkout@v4 configuration in the checkout step to set
persist-credentials to false, since this review workflow only needs read access.
Keep the change scoped to the existing checkout action block so the repository
can still be cloned without leaving reusable credentials in git config.

Source: Linters/SAST tools


30-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider updating actions/checkout beyond v4.

actions/checkout has since released major versions beyond v4, and GitHub Actions runners are moving JS actions to newer Node runtimes, which can surface deprecation warnings on older action majors. Worth confirming the intended pinned version for this repo's workflows.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude-code-review.yml at line 30, The workflow is pinned
to an older major of actions/checkout, so update the checkout step in the GitHub
Actions workflow to the intended newer supported major and confirm the repo’s
pinning policy. Use the actions/checkout usage in the claude-code-review
workflow as the locator, and keep the version aligned with current GitHub
Actions runner/runtime recommendations.
.github/workflows/claude.yml (1)

28-31: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Set persist-credentials: false on checkout.

Same as flagged in claude-code-review.yml: The auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set persist-credentials: false to opt-out. This is more important here given the trigger surface is broader/untrusted (see comment on Line 15).

🔒 Proposed fix
       - name: Checkout repository
         uses: actions/checkout@v4
         with:
           fetch-depth: 1
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude.yml around lines 28 - 31, Update the Checkout
repository step in the claude workflow to opt out of persisting the GitHub token
in local git config. In the actions/checkout usage, add persist-credentials set
to false so scripts in this broader trigger surface cannot run authenticated git
commands; keep the change scoped to the checkout step identified by
actions/checkout@v4.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/claude.yml:
- Around line 15-19: Gate the existing `@claude` trigger in the claude workflow so
only trusted users can invoke it; the current job condition in the workflow
`if:` block matches comment/body mentions from anyone and can reach steps using
`secrets.CLAUDE_CODE_OAUTH_TOKEN`. Update the condition to combine the mention
checks with an `author_association` allowlist (OWNER, MEMBER, COLLABORATOR) for
the relevant events, and keep the logic localized to the same workflow trigger
expression so untrusted commenters cannot start the job.

In @.github/workflows/codeql.yml:
- Around line 59-60: The checkout step in the CodeQL workflow should not persist
the GITHUB_TOKEN in local git config. Update the existing actions/checkout@v4
step in the workflow to set persist-credentials to false so later steps cannot
access the token unnecessarily. Keep the change scoped to the checkout
configuration in the workflow file.

In @.github/workflows/semgrep.yml:
- Around line 35-36: The checkout step in the Semgrep workflow is persisting the
GitHub token unnecessarily for a scan-only job. Update the `actions/checkout@v4`
step in the workflow to set `persist-credentials: false`, matching the safer
pattern used elsewhere such as in `codeql.yml`, so the credentials are not left
in the local git config.
- Around line 38-42: The workflow still uses the deprecated
returntocorp/semgrep-action, so update the semgrep job to use the native
semgrep/semgrep CI flow instead. Replace the action step in the semgrep workflow
with a semgrep ci invocation, and preserve the existing Semgrep configuration
inputs such as token/deployment handling and SARIF generation if needed. Use the
semgrep job/step in the workflow as the place to make the change.

---

Nitpick comments:
In @.github/workflows/claude-code-review.yml:
- Around line 29-32: The Checkout repository step in the workflow should opt out
of persisting the auth token. Update the actions/checkout@v4 configuration in
the checkout step to set persist-credentials to false, since this review
workflow only needs read access. Keep the change scoped to the existing checkout
action block so the repository can still be cloned without leaving reusable
credentials in git config.
- Line 30: The workflow is pinned to an older major of actions/checkout, so
update the checkout step in the GitHub Actions workflow to the intended newer
supported major and confirm the repo’s pinning policy. Use the actions/checkout
usage in the claude-code-review workflow as the locator, and keep the version
aligned with current GitHub Actions runner/runtime recommendations.

In @.github/workflows/claude.yml:
- Around line 28-31: Update the Checkout repository step in the claude workflow
to opt out of persisting the GitHub token in local git config. In the
actions/checkout usage, add persist-credentials set to false so scripts in this
broader trigger surface cannot run authenticated git commands; keep the change
scoped to the checkout step identified by actions/checkout@v4.

In @.github/workflows/semgrep.yml:
- Line 46: The semgrep workflow is pinning github/codeql-action/upload-sarif to
a different major version than the other CodeQL workflow steps, so align the
shared codeql-action version across workflows. Update the upload-sarif step to
match the v4 family used by codeql.yml, and verify the surrounding CodeQL job
configuration still references the same action major version consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c50d23f-3d7d-4cd6-94c3-2d1a0ca675c8

📥 Commits

Reviewing files that changed from the base of the PR and between b51f060 and 2cc4444.

📒 Files selected for processing (5)
  • .github/workflows/claude-code-review.yml
  • .github/workflows/claude.yml
  • .github/workflows/codeql.yml
  • .github/workflows/semgrep.yml
  • docs/Usage.md

Comment on lines +15 to +19
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "## claude workflow"
if [ -f .github/workflows/claude.yml ]; then
  cat -n .github/workflows/claude.yml | sed -n '1,260p'
else
  echo "missing .github/workflows/claude.yml"
fi

echo
echo "## search for related references"
rg -n --hidden -S "author_association|`@claude`|pull_request_review_comment|pull_request_review|issue_comment|issues:|permissions:|secrets?\.|id-token:write|contents:read|issues:read|pull-requests:read|actions:read" .github/workflows . || true

Repository: SasanLabs/VulnerableApp

Length of output: 8852


Gate @claude behind trusted associations in .github/workflows/claude.yml:15-19.
Right now any user can mention @claude in an issue/PR comment or issue body and trigger a job that reads ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}. Add an author_association check (OWNER/MEMBER/COLLABORATOR) alongside the mention match so untrusted commenters can’t invoke Claude on repo-owned secrets.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/claude.yml around lines 15 - 19, Gate the existing `@claude`
trigger in the claude workflow so only trusted users can invoke it; the current
job condition in the workflow `if:` block matches comment/body mentions from
anyone and can reach steps using `secrets.CLAUDE_CODE_OAUTH_TOKEN`. Update the
condition to combine the mention checks with an `author_association` allowlist
(OWNER, MEMBER, COLLABORATOR) for the relevant events, and keep the logic
localized to the same workflow trigger expression so untrusted commenters cannot
start the job.

Comment on lines +59 to +60
- name: Checkout repository
uses: actions/checkout@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Set persist-credentials: false on checkout.

Checkout persists the GITHUB_TOKEN in the local git config by default, exposing it to all subsequent steps in the job unnecessarily since this workflow only reads code.

🔒 Proposed fix
     - name: Checkout repository
       uses: actions/checkout@v4
+      with:
+        persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 59-68: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/codeql.yml around lines 59 - 60, The checkout step in the
CodeQL workflow should not persist the GITHUB_TOKEN in local git config. Update
the existing actions/checkout@v4 step in the workflow to set persist-credentials
to false so later steps cannot access the token unnecessarily. Keep the change
scoped to the checkout configuration in the workflow file.

Source: Linters/SAST tools

Comment on lines +35 to +36
- uses: actions/checkout@v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Set persist-credentials: false on checkout.

Same concern as in codeql.yml: the token is persisted unnecessarily for a scan-only job.

🔒 Proposed fix
       - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 35-37: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/semgrep.yml around lines 35 - 36, The checkout step in the
Semgrep workflow is persisting the GitHub token unnecessarily for a scan-only
job. Update the `actions/checkout@v4` step in the workflow to set
`persist-credentials: false`, matching the safer pattern used elsewhere such as
in `codeql.yml`, so the credentials are not left in the local git config.

Source: Linters/SAST tools

Comment on lines +38 to +42
- uses: returntocorp/semgrep-action@fcd5ab7459e8d91cb1777481980d1b18b4fc6735
with:
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
generateSarif: "1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the referenced lines.
sed -n '1,120p' .github/workflows/semgrep.yml

# Look for any Semgrep-related migration hints in the repo.
rg -n "semgrep|returntocorp/semgrep-action|semgrep/semgrep" .github README* .

Repository: SasanLabs/VulnerableApp

Length of output: 2290


🌐 Web query:

returntocorp/semgrep-action deprecated semgrep/semgrep official GitHub Actions configuration docs

💡 Result:

The GitHub Action repository returntocorp/semgrep-action is officially deprecated [1][2][3]. Users are advised to stop using this wrapper script and instead migrate to native Semgrep support in their GitHub Actions pipelines [1][4]. To implement Semgrep natively, you should configure your GitHub Actions workflow to run the semgrep/semgrep Docker image directly [5][6]. This eliminates the need for a third-party wrapper action [1]. Official configuration guidelines and sample YAML files for native integration can be found in the Semgrep documentation at: https://docs.semgrep.dev/semgrep-ci/sample-ci-configs [5]. A standard implementation typically involves adding a job to your.github/workflows/semgrep.yml file that uses the semgrep/semgrep container image and executes the semgrep ci command [5]: jobs: semgrep: name: semgrep/ci runs-on: ubuntu-latest container: image: semgrep/semgrep steps: - uses: actions/checkout@v4 - run: semgrep ci env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}

Citations:


Replace the deprecated Semgrep action

returntocorp/semgrep-action is deprecated; switch this workflow to the native semgrep/semgrep CI flow (semgrep ci) instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/semgrep.yml around lines 38 - 42, The workflow still uses
the deprecated returntocorp/semgrep-action, so update the semgrep job to use the
native semgrep/semgrep CI flow instead. Replace the action step in the semgrep
workflow with a semgrep ci invocation, and preserve the existing Semgrep
configuration inputs such as token/deployment handling and SARIF generation if
needed. Use the semgrep job/step in the workflow as the place to make the
change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants