@@ -209,7 +209,59 @@ Click on the security alert and notice that it details when the fix was made, by
209
209
210
210
</p >
211
211
</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
+
213
265
## Next Steps
214
266
215
267
Ready to talk about advanced security features for GitHub Enterprise? [ Contact Sales] ( https://enterprise.github.com/contact ) for more information!
0 commit comments