Skip to content

Conversation

@felickz
Copy link
Collaborator

@felickz felickz commented Sep 2, 2025

Default to latest version of opengrep

Copilot AI review requested due to automatic review settings September 2, 2025 14:49
@felickz felickz requested a review from a team as a code owner September 2, 2025 14:49
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@felickz
Copy link
Collaborator Author

felickz commented Sep 2, 2025

@copilot

Add additional - input vars to control:

  # Release version of Opengrep
  # https://github.com/opengrep/opengrep/releases
  RELEASE_VERSION: v1.1.2
  # Asset from release
  PLATFORM: opengrep_manylinux_x86

Then if either of those are set - pull the binary from: 
  "https://github.com/opengrep/opengrep/releases/download/${RELEASE_VERSION}/{PLATFORM}"

@felickz
Copy link
Collaborator Author

felickz commented Sep 2, 2025

@copilot

Add additional - input vars to control:

  # Release version of Opengrep
  # https://github.com/opengrep/opengrep/releases
  RELEASE_VERSION: v1.1.2
  # Asset from release
  PLATFORM: opengrep_manylinux_x86

Then if either of those are set - pull the binary from: 
  "https://github.com/opengrep/opengrep/releases/download/${RELEASE_VERSION}/{PLATFORM}"

Guess you cant do that on a non copilot initiated PR :TIL:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

if: steps.detect-languages.outputs.java != 'true' && steps.detect-languages.outputs.kotlin != 'true' && steps.detect-languages.outputs.javascript != 'true' && steps.detect-languages.outputs.typescript != 'true' && steps.detect-languages.outputs.go != 'true' && steps.detect-languages.outputs.codeql != 'true' && steps.detect-languages.outputs.python != 'true'
run: |
gh pr edit ${{ github.event.number }} --add-reviewer felickz --add-reviewer Geekmasher --add-reviewer adrienpessu
gh pr edit ${{ github.event.number }} --add-reviewer felickz --add-reviewer felickz --add-reviewer adrienpessu --repo $GITHUB_REPOSITORY

Check warning

Code scanning / CodeQL

Code injection Medium

Potential code injection in
${ github.event.number }
, which may be controlled by an external user.

Copilot Autofix

AI 4 months ago

To fix this code injection vulnerability: Pass the value of github.event.number to an environment variable using the env: map in the step, and access it using the native shell variable syntax (i.e., $PR_NUMBER) instead of direct interpolation. Specifically, for line 48, introduce an environment variable like PR_NUMBER: ${{ github.event.number }} in the step and update the shell command to use $PR_NUMBER. This change should be applied only to the affected step. No imports, methods, or external definitions are needed; only the workflow YAML step is altered to properly pass the input.


Suggested changeset 1
.github/workflows/language-detection-and-assignment.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/language-detection-and-assignment.yml b/.github/workflows/language-detection-and-assignment.yml
--- a/.github/workflows/language-detection-and-assignment.yml
+++ b/.github/workflows/language-detection-and-assignment.yml
@@ -44,5 +44,7 @@
 
       - name: Assign default
         if: steps.detect-languages.outputs.java != 'true' && steps.detect-languages.outputs.kotlin != 'true' && steps.detect-languages.outputs.javascript != 'true' && steps.detect-languages.outputs.typescript != 'true' && steps.detect-languages.outputs.go != 'true'  && steps.detect-languages.outputs.codeql != 'true' && steps.detect-languages.outputs.python != 'true'  
+        env:
+          PR_NUMBER: ${{ github.event.number }}
         run: |
-          gh pr edit ${{ github.event.number }} --add-reviewer felickz --add-reviewer felickz --add-reviewer adrienpessu --repo $GITHUB_REPOSITORY 
+          gh pr edit $PR_NUMBER --add-reviewer felickz --add-reviewer felickz --add-reviewer adrienpessu --repo $GITHUB_REPOSITORY 
EOF
@@ -44,5 +44,7 @@

- name: Assign default
if: steps.detect-languages.outputs.java != 'true' && steps.detect-languages.outputs.kotlin != 'true' && steps.detect-languages.outputs.javascript != 'true' && steps.detect-languages.outputs.typescript != 'true' && steps.detect-languages.outputs.go != 'true' && steps.detect-languages.outputs.codeql != 'true' && steps.detect-languages.outputs.python != 'true'
env:
PR_NUMBER: ${{ github.event.number }}
run: |
gh pr edit ${{ github.event.number }} --add-reviewer felickz --add-reviewer felickz --add-reviewer adrienpessu --repo $GITHUB_REPOSITORY
gh pr edit $PR_NUMBER --add-reviewer felickz --add-reviewer felickz --add-reviewer adrienpessu --repo $GITHUB_REPOSITORY
Copilot is powered by AI and may make mistakes. Always verify output.
- name: "Run Opengrep"
run: opengrep scan --metrics=on --sarif-output ./results.sarif .
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was deprecated

@felickz felickz merged commit 8f0c1ed into main Sep 2, 2025
5 checks passed
@felickz felickz deleted the opengrep-latest branch September 2, 2025 21:58
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.

4 participants