You enabled GitHub code scanning and opened a pull request from a non-default branch, but the scanning report shows “Analysis not found.” Which two actions will ensure code scanning completes successfully for the pull request?
Choose an answer
Tap an option to check your answer.
Correct answer: Add the name of the non-default branch to the on:push specification in the code scanning workflow., Update the code in the pull request..
Why this is the answer
Code scanning workflows typically trigger on push events to the default branch and pullrequest events. If a pull request from a non-default branch shows "Analysis not found," it means the scan either didn't run or failed to complete. To ensure it runs: 1. Add the name of the non-default branch to the on:push specification in the code scanning workflow. This explicitly tells the workflow to run a scan when changes are pushed to that specific branch, ensuring analysis occurs before the pull request is even created or updated. 2. Update the code in the pull request. This action triggers a new pullrequest event, which will re-run the code scanning workflow if it's configured to run on pullrequest events. This is often the simplest way to re-trigger a scan after making changes or if an initial scan failed. Incorrect options: Adding the default branch to on:push won't help a non-default branch's pull request. Deleting and re-raising from the default branch defeats the purpose of feature branches and is not a practical solution for enabling scanning on a specific pull request. Adding a new workflow is unnecessary; the existing one can be modified.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed