Azure DevOps PR annotations is not showing for github adavanced security

ahd 210 Reputation points
2025-06-04T02:12:03.4233333+00:00

After enabling GitHub advanced security the analysis results are getting posted on Advanced security plane but no PR annotations are posted for Pull requests. Is any additional settings required in pipeline or settings ?User's image

Azure DevOps
0 comments No comments
{count} votes

Accepted answer
  1. Durga Reshma Malthi 4,430 Reputation points Microsoft External Staff Moderator
    2025-06-04T09:50:10.6033333+00:00

    Hi ahd

    Could you please follow the below steps to resolve this issue:

    1. Ensure the workflow includes the pull request trigger:
         on:
           pull_request:
             branches:
               - main
      
      If this trigger is missing, GitHub won’t annotate PRs.
    2. Go to your Repository -> Security -> Code scanning alerts -> Click on setup code scanning -> select codeql analysis. This ensures CodeQL runs whenever a PR is created.
    3. Add the following permissions to your workflow, this allows CodeQL to post annotations on PRs.
         permissions:
           contents: read
           security-events: write
      

    Hope this helps!

    Please Let me know if you have any queries.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.