How do you handle a leaked secret in GitHub Actions logs?
AdvancedProductionGitHub Actions and GitLab CI in Production
Answer
Assume compromise. Rotate the secret first, then delete the affected workflow run logs (deletion hides the exposure, but does not undo it), review where the secret was used and check provider audit logs for misuse, and find the root cause (an echo, a debug flag, a tool printing its config, base64-encoded values that evade masking). Enable secret scanning and push protection, mask derived values with ::add-mask::, and migrate to OIDC so no long-lived secret remains.
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle approvals and deployments across environments in GitHub Actions?IntermediateHow do you handle required checks when workflows use path filters or matrices?Advanced