Skip to content

Commit 89773c0

Browse files
committed
Update README content
- Prevent new Alerts in a Pull Request
1 parent c2478e0 commit 89773c0

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

+53-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,59 @@ Click on the security alert and notice that it details when the fix was made, by
209209

210210
</p>
211211
</details>
212-
212+
213+
<details>
214+
<summary>Prevent new Alerts in a Pull Request</summary>
215+
<p>
216+
217+
#### Create Pull Request from new feature Branch
218+
219+
Now that we have setup CodeQL Analysis and have fix a security alert, we can try to introduce an alert into a Pull Request.
220+
221+
Create a new Pull Request with the base branch as your `main` branch and the compare branch as the `new-feature` branch.
222+
223+
<img src="images/17-create-pull-request.png" width="70%"/>
224+
225+
Make sure that the base branch is set to your own repositories `main` branch versus the original repository's `main` branch.
226+
227+
228+
#### Pull Request Status Check
229+
230+
Once the Pull Request has been created, you will notice that the CodeQL Analysis has started as a status check. Wait until it completes.
231+
232+
<img src="images/18-pr-in-progress.png" width="80%"/>
233+
234+
After the Workflow has completed, the `Code Scanning Results / CodeQL` status check will have failed.
235+
Notice that Code Scanning has detected that this Pull Request introduces a new security alert.
236+
237+
<img src="images/19-pr-check-failed.png" width="80%"/>
238+
239+
240+
#### Alert Centric Notifications
241+
242+
Directly in the Pull Request, you will notice that GitHub Code Scanning bot has left a review of the Pull Request with the security alert details.
243+
This will help developers to quickly identify security issues introduced in their Pull Requests.
244+
245+
<img src="images/20-pr-review.png" width="80%"/>
246+
247+
248+
This also allows for collaboration between developers and security teams to discuss the security alert and how to remediate it.
249+
250+
<img src="images/21-pr-review-collaboration.png" width="80%"/>
251+
252+
#### Security Alert Details
253+
254+
Click on `Show more details` by the new `Code Scanning Alert` to jump to the `Security` tab and view the security alert details.
255+
256+
<img src="images/22-pr-show-more-details.png" width="80%"/>
257+
258+
Notice that the security alert was found `In pull request` and not in the `main` branch (production).
259+
260+
261+
</p>
262+
</details>
263+
264+
213265
## Next Steps
214266

215267
Ready to talk about advanced security features for GitHub Enterprise? [Contact Sales](https://enterprise.github.com/contact) for more information!

0 commit comments

Comments
 (0)