Back to cheat sheet hub

Git and GitHub Actions Cheat Sheet

A practical source-control and CI reference for testers and SDETs working on modern automation projects.

Playwright Module 8 Selenium Module 9 CI workflows

Core Git Commands

These are the commands most testers need every week.

git status
git add .
git commit -m "message"
git pull
git push

Branch Workflow

Use feature branches to keep work isolated and reviewable.

git checkout -b feature/login-fix

Pull Requests

Pull requests are the review layer between working code and shared code.

Good PRs include:
- summary
- screenshots if needed
- test evidence
- risk notes

Workflow File Basics

GitHub Actions workflows are defined in YAML files under .github/workflows.

name: CI
on: [push, pull_request]

Jobs and Steps

Jobs contain steps, and jobs can run in parallel if designed that way.

jobs:
  test:
    steps:
      - uses: actions/checkout@v4

Matrix Builds

Matrix strategy helps run the same workflow across multiple environments.

strategy:
  matrix:
    browser: [chromium, firefox]

Artifacts

Upload reports and traces so failures can be debugged after the run finishes.

Good artifacts:
- screenshots
- traces
- HTML report
- test-results

Secrets

Store tokens and keys in repository or environment secrets, never in the workflow file itself.

${{ secrets.CLOUDFLARE_API_TOKEN }}

Caching

Caching dependencies can reduce build times significantly when configured well.

Use cache for:
- npm dependencies
- Playwright browsers
- tool-specific package caches