How do you debug a GitHub Actions job that works locally but fails in CI?
BeginnerProductionGitHub Actions and GitLab CI in Production
Answer
Compare environments: runner image versions (the runner image's tool versions are listed in the job's "Set up job" log), shell defaults, environment variables, working directory, shallow checkout, file permissions, and case-sensitive file systems (macOS dev machines versus Linux runners). Enable step debug logging, print env, pwd and tool versions, and reproduce in the same container image locally. Pin tool versions with setup actions instead of relying on the runner defaults.
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