You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Hi @${{ github.actor }}, I've received your request, and I'm working on it now! You can track my progress [in the logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
* add folder to contain artifacts ([e03b2c6](https://github.com/gemini-cli-extensions/security/commit/e03b2c60d7b0ca3256533125175f43c9758236ce))
9
+
* add folder to contain security artifacts ([2fe3588](https://github.com/gemini-cli-extensions/security/commit/2fe35888d5cff981c88ef31fae3daf39c6a695ef))
10
+
* Add preamble to security scan to make confirms user's decision to use command or manual security auditing ([67658d5](https://github.com/gemini-cli-extensions/security/commit/67658d587472be8283bc5aa00864429786bd1500))
11
+
***GHA workflows:** Add run-gemini-cli GHA workflows to repo PR's ([facc88b](https://github.com/gemini-cli-extensions/security/commit/facc88be48db43b3b8482ff6a6d19d34fd0513e1))
12
+
***GitHub Action:** Add /security:github-pr command for use with run-gemini-cli GitHub Action ([59db0ad](https://github.com/gemini-cli-extensions/security/commit/59db0add3f6aee54821570725f1c33859c24bc4d))
13
+
14
+
15
+
### Bug Fixes
16
+
17
+
* Diff issues were due to non remote repositories, support local changes by defulating to ([53a52c6](https://github.com/gemini-cli-extensions/security/commit/53a52c650c07575a18840b5b357eb80d8941c304))
18
+
***GHA:** Gemini-review MCP calls and prompt changes ([6d2d20f](https://github.com/gemini-cli-extensions/security/commit/6d2d20f070e034a90fdb7b6369b600f71d539430))
19
+
***GHA:** Gemini-review MCP calls and prompt changes ([ad93687](https://github.com/gemini-cli-extensions/security/commit/ad936878615d772cf00e17eb9e24d2c813e37a61))
* nit white space and revert deletion prompt to only affect temp files ([9d64b30](https://github.com/gemini-cli-extensions/security/commit/9d64b307eec2946b2f155a062febefae1c7f03bb))
22
+
* phrasing and whitespace ([4fb13d6](https://github.com/gemini-cli-extensions/security/commit/4fb13d651822619d1f442bdd4226d81ec9ec4bac))
23
+
* remove additional test causing gemini cli to try to run a command ([2caa615](https://github.com/gemini-cli-extensions/security/commit/2caa615f2f4563034ecc92842fec7583dbd102d1))
24
+
* suggest user to run commands themselves, since gemini cli cannot correctly run it's own commands. ([caafd73](https://github.com/gemini-cli-extensions/security/commit/caafd7399b3ddae851f701885a74468a55a36424))
25
+
* suggest user to run commands themselves, since gemini cli cannot… ([96f84f9](https://github.com/gemini-cli-extensions/security/commit/96f84f95d327482f4c5d8ddc267ea3f271aebcdb))
26
+
* use to store line number mappings in the MCP server ([#91](https://github.com/gemini-cli-extensions/security/issues/91)) ([909c901](https://github.com/gemini-cli-extensions/security/commit/909c901fd0a9b181b13a6462d50de7ca5acf4a5e))
27
+
* Use a command available on all platforms to generate a file diff ([21fc350](https://github.com/gemini-cli-extensions/security/commit/21fc35037b22b7acf51e7c78a5eb233d2f02cff3))
28
+
* Use a command available on all platforms to generate a file diff ([f1fca9b](https://github.com/gemini-cli-extensions/security/commit/f1fca9bd98bef7f10f957701d5ca4fd69c9f2e9c))
29
+
* whitespace at end fo file ([4257532](https://github.com/gemini-cli-extensions/security/commit/4257532aaa734171bfcf083deba8472c6e8453a7))
Copy file name to clipboardExpand all lines: GEMINI.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ You are a highly skilled senior security and privacy engineer. You are meticulou
25
25
2. **Manual Review**: I can manually review the code for potential vulnerabilities based on our conversation.
26
26
```
27
27
* Explicitly ask the user which they would prefer before proceeding. The manual analysis is your default behavior if the user doesn't choose the command. If the user chooses the command, remind them that they must run it on their own.
28
-
* During the security analysis, you **MUST NOT** write, modify, or delete any files unless explicitly instructed by a command (eg. `/security:analyze`)
28
+
* During the security analysis, you **MUST NOT** write, modify, or delete any files unless explicitly instructed by a command (eg. `/security:analyze`). Artifacts created during security analysis should be stored in a `.gemini_security/` directory in the user's workspace.
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,23 @@ By default, the `/security:analyze` command determines the scope of the analysis
39
39
40
40
## GitHub Integration
41
41
42
-
Coming soon!
42
+
### I already use [run-gemini-cli](https://github.com/google-github-actions/run-gemini-cli) workflows in my repository:
43
+
44
+
* Replace your existing `gemini-review.yml` with this [updated workflow](https://github.com/gemini-cli-extensions/security/blob/main/.github/workflows/gemini-review.yml), which includes the new Security Analysis step.
45
+
46
+
### I don't use [run-gemini-cli](https://github.com/google-github-actions/run-gemini-cli) workflows in my repository yet:
47
+
48
+
1. Integrate the Gemini CLI Security Extension into your GitHub workflow to analyze incoming code:
49
+
50
+
2. Follow Steps 1-3 in this [Quick Start](https://github.com/google-github-actions/run-gemini-cli?tab=readme-ov-file#quick-start).
51
+
52
+
3. Create a `.github/workflows` directory in your repository's root (if it doesn't already exist).
53
+
54
+
4. Copy this [Example Workflow](https://github.com/gemini-cli-extensions/security/blob/main/.github/workflows/gemini-review.yml) into the `.github/workflows` directory. See the run-gemini-cli [configuration](https://github.com/google-github-actions/run-gemini-cli?tab=readme-ov-file#configuration) to make changes to the workflow.
55
+
56
+
5. Ensure the new workflow file is committed and pushed to GitHub.
57
+
58
+
6. Open a new pull request, or comment `@gemini-cli /review` on an existing PR, to run the Gemini CLI Code Review along with Security Analysis.
Copy file name to clipboardExpand all lines: commands/security/analyze-github-pr.toml
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
description = "Only to be used with the run-gemini-cli GitHub Action. Analyzes code changes on a GitHub PR for common security vulnerabilities"
2
-
prompt = """You are a highly skilled senior security analyst. You operate within a secure GitHub Actions environment. Your primary task is to conduct a security audit of the current pull request.
2
+
prompt = """
3
+
You are a highly skilled senior security analyst. You operate within a secure GitHub Actions environment. Your primary task is to conduct a security audit of the current pull request.
3
4
Utilizing your skillset, you must operate by strictly following the operating principles defined in your context.
4
5
5
6
@@ -108,12 +109,12 @@ You will now begin executing the plan. The following are your precise instructio
108
109
1. **To complete the 'Define the audit scope' task:**
109
110
110
111
* Input Data
111
-
- Retrieve the GitHub repository name from the environment variable "${REPOSITORY}".
112
-
- Retrieve the GitHub pull request number from the environment variable "${PULL_REQUEST_NUMBER}".
113
-
- Retrieve the additional user instructions and context from the environment variable "${ADDITIONAL_CONTEXT}".
114
-
- Use `mcp__github__get_pull_request` to get the title, body, and metadata about the pull request.
115
-
- Use `mcp__github__get_pull_request_files` to get the list of files that were added, removed, and changed in the pull request.
116
-
- Use `mcp__github__get_pull_request_diff` to get the diff from the pull request. The diff includes code versions with line numbers for the before (LEFT) and after (RIGHT) code snippets for each diff.
- **Additional User Instructions**: !{echo $ADDITIONAL_CONTEXT}
115
+
- Use `pull_request_read.get` to get the title, body, and metadata about the pull request.
116
+
- Use `pull_request_read.get_files` to get the list of files that were added, removed, and changed in the pull request.
117
+
- Use `pull_request_read.get_diff` to get the diff from the pull request. The diff includes code versions with line numbers for the before (LEFT) and after (RIGHT) code snippets for each diff.
117
118
118
119
* Once the command is executed and you have the list of changed files, you will mark this task as complete.
119
120
@@ -129,9 +130,9 @@ After completing these two initial tasks, continue executing the dynamically gen
129
130
130
131
After your **Core Operational Loop** is completed, report the final report back to GitHub:
131
132
132
-
3.1 **Create Pending Review:** Call `mcp__github__create_pending_pull_request_review`. Ignore errors like "can only have one pending review per pull request" and proceed to the next step.
133
+
3.1 **Create Pending Review:** Call `create_pending_pull_request_review`. Ignore errors like "can only have one pending review per pull request" and proceed to the next step.
133
134
134
-
3.2 **Add Comments and Suggestions:** For each formulated review comment, call `mcp__github__add_comment_to_pending_review`.
135
+
3.2 **Add Comments and Suggestions:** For each formulated review comment, call `add_comment_to_pending_review`.
135
136
136
137
2a. When there is a code suggestion (preferred), structure the comment payload using this exact template:
137
138
@@ -149,7 +150,7 @@ After completing these two initial tasks, continue executing the dynamically gen
149
150
{{SEVERITY}} {{COMMENT_TEXT}}
150
151
</COMMENT>
151
152
152
-
3.3 **Submit Final Review:** Call `mcp__github__submit_pending_pull_request_review` with a summary comment. **DO NOT** approve the pull request. **DO NOT** request changes. The summary comment **MUST** use this exact markdown format:
153
+
3.3 **Submit Final Review:** Call `submit_pending_pull_request_review` with a summary comment. **DO NOT** approve the pull request. **DO NOT** request changes. The summary comment **MUST** use this exact markdown format:
153
154
154
155
<SUMMARY>
155
156
## 📋 Security Analysis Summary
@@ -162,4 +163,5 @@ After completing these two initial tasks, continue executing the dynamically gen
162
163
- Keep this section concise and do not repeat details already covered in inline comments.
0 commit comments