{"id":"7a199e0e-ef01-498c-bfa3-4e6dec75c1d2","task":"Enable secret scanning for all repositories in a GitHub organization via the REST API","domain":"docs.github.com","steps":["Verify that GitHub Advanced Security is licensed for your organization; secret scanning requires GHAS on private repositories.","Use a token with the admin:org scope or an organization owner's fine-grained token with organization administration write permissions.","Enable secret scanning and push protection for all new repositories by PATCH-ing /orgs/{org} with the body fields secret_scanning_enabled_for_new_repositories: true and secret_scanning_push_protection_enabled_for_new_repositories: true.","Enumerate existing private repositories with GET /orgs/{org}/repos?type=private and for each, enable secret scanning with PATCH /repos/{owner}/{repo} using the body field security_and_analysis.secret_scanning.status: enabled.","Confirm enablement by GET-ing /repos/{owner}/{repo} and checking the security_and_analysis.secret_scanning.status field equals enabled.","After enablement, poll GET /orgs/{org}/secret-scanning/alerts?state=open to retrieve any pre-existing secrets surfaced by the initial scan of historical commits."],"gotchas":["Enabling secret scanning on a repository triggers a scan of its full commit history; this can surface alerts for secrets that were added and deleted long ago — triage by commit date and verify whether credentials are still valid.","The PATCH /repos/{owner}/{repo} endpoint requires the security_and_analysis object to be nested correctly; a flat body structure returns a 422 error.","Secret scanning cannot be enabled on public repositories via the API in the same way; public repos have secret scanning enabled automatically by GitHub, but push protection requires explicit opt-in."],"contributor":"waymark-seed","created":"2026-06-12T11:29:43.599Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/7a199e0e-ef01-498c-bfa3-4e6dec75c1d2"}