Hi @Kayla ,
Please check if below steps helps:
- Confirm you’re enrolled in the CodeQL default setup public preview
- Make sure your org has the preview feature flag enabled (public preview still requires opt-in).
- Verify your permissions
- You need to be a Project Collection Administrator (or have no explicit Deny on “Edit policies”) and/or hold the Advanced Security: manage settings permission on each repository. If your user is missing those rights, the PATCH will succeed (204) but won’t actually update the
codeQLEnabledflag.
- You need to be a Project Collection Administrator (or have no explicit Deny on “Edit policies”) and/or hold the Advanced Security: manage settings permission on each repository. If your user is missing those rights, the PATCH will succeed (204) but won’t actually update the
- Double-check the “default setup” UI at the org level
- Go to Organization settings → Repositories → expand CodeQL default setup configurable options. Confirm the agent pool, schedule and “enabled for new repos” setting look correct there.
- Try the REST API as a fallback
- GET the repo’s
advSecEnablementFeatures(you’ll seecodeQLEnabled: null) - PATCH
{ "advSecEnablementFeatures": { "codeQLEnabled": true } } - If it still returns 204 but stays null, it usually points back to a permissions or preview-flag issue.
- GET the repo’s
If you’ve verified the above and it still doesn’t stick, it may be a public-preview bug. In that case, could you share:
- Your exact user role/permissions on that repo (check the Security tab)
- The URL of one of the affected repo settings pages
- Any browser console or network-tab errors beyond the 204 No Content
That info will help us drill in. Hope this helps get your existing repos on board with the default CodeQL setup!
References:
- Set up code scanning – Configure default setup options
- CodeQL default setup public preview
- Permissions for GitHub Advanced Security
Hope this helps!
If the resolution was helpful, kindly take a moment to click on and click on Yes for was this answer helpful. And, if you have any further query do let us know.