RousselTMLEARNING

DevOps

GitHub Actions best practices and troubleshooting

Running GitHub Actions: speeding up and cutting costs, debugging (debug logs, act locally, gh run), frequent errors, governance of allowed actions and checklist.

1. Speed and costs #

Fewer minutes, more feedback.

Levers #

Security measures
  • Dependency cache, paths filters, concurrency with cancellation, reduced matrices on pull requests and full ones on main.
  • timeout-minutes on every job: otherwise a stuck job consumes up to 6 hours.
  • Short artifact retention (retention-days) and Linux runners whenever possible (Windows and macOS cost more).

2. Debugging #

Understanding a failure.

Frequent errors #

SymptomLikely cause
Resource not accessible by integrationinsufficient GITHUB_TOKEN permissions
Workflow not triggeredbranches/paths filter, or workflow missing from the default branch (schedule, dispatch)
Empty secret on a fork PRnormal behaviour: secrets are not passed to forks
Job queued foreverno runner with the requested labels, or pending environment approval

Create the ACTIONS_STEP_DEBUG secret set to true (or rerun with "Enable debug logging") for detailed logs; act runs a workflow locally in Docker to iterate faster.

Checklist #

ItemCheck
Securityleast permissions, pinned actions, OIDC, no public self-hosted runner
Reliabilityrequired checks before merge, timeouts
Deliveryprotected environments, attestations, same image promoted
Governancelist of allowed actions at organization level, versioned reusable workflows

Commands to know #

Commands to know
  • act -j test : run the test job locally
  • gh run view <id> --log : full log
  • gh run rerun <id> --debug : rerun with debug logs

Sources #

Checked in November 2026: CI/CD platforms change every month, check versions and plans in the vendor's documentation.

Related articles

GitHub Actions: concepts and how it works

Discover GitHub Actions: events, workflows, jobs, steps and actions, the Marketplace, hosted runners, minute …

Writing GitHub Actions workflows

Mastering workflow syntax: triggers and filters, jobs and needs, matrices, if conditions, contexts and expres…

GitHub Actions runners: hosted, self-hosted and ARC

Choosing where workflows run: hosted runners and images, larger runners, self-hosted runners (installation, l…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!