← All insightsBest Practices

GitHub Actions best practices for teams

Nir Geier, CodeWizard · 13 July 2026 · 3 min read · Intermediate

GitHub Actions rewards a little discipline. These are the practices that keep it maintainable as a team and a codebase grow.

The practices

  • Pin actions to a commit SHA and review third-party actions before use
  • Use OIDC for cloud auth and set minimal permissions blocks
  • Cache dependencies and split long jobs with a matrix

What good looks like

A CI workflow with caching and a matrix build.

yaml
name: ci
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix: { node: [18, 20, 22] }
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: ${{ matrix.node }}, cache: npm }
      - run: npm ci
      - run: npm test

Anti-patterns to retire

  • Using un-pinned third-party actions (tag can move under you) - pin to a SHA
  • Storing cloud keys as secrets instead of using OIDC
  • Over-broad GITHUB_TOKEN permissions; scope them per job

Want senior help putting GitHub Actions to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult