liveBook · Manning

Single responsibility principle

As explained in GitHub Actions in Action: Continuous integration and delivery for DevOps

The single responsibility principle is a software design principle stating that a component should have one primary responsibility and one reason to change.

The single responsibility principle keeps automation components focused: an action should do one thing well, while a workflow should have a clearly defined goal and reason to run. section 4.6 section 8.4.6

Apply the principle through focused automation boundaries:

  • Keep shared actions small and avoid Swiss-army-knife interfaces with many inputs and unrelated capabilities. section 4.6
  • Create workflow files around specific purposes so source or dependency changes affect only the relevant automation. section 8.4.6
  • Use separate jobs when work must run on different machines; jobs may distribute identical work without defining separate responsibilities. section 8.4.6
  • Support focused actions with tests, semantic versioning, documentation, clear metadata, and concrete usage examples. section 4.6

Focused workflow organization

Separate automation by goal, use development-cycle events and a branching strategy to trigger the appropriate workflow, and reserve multiple jobs for machine distribution or other justified needs. This reduces maintenance cognitive load and narrows review responsibility, especially where production changes require separation of duties. section 8.4.6

How GitHub Actions in Action: Continuous integration and delivery for DevOps covers it

How deep it goes
Explains practical boundaries for actions, workflows, and jobs, while treating the principle as guidance rather than an absolute rule.
Examples
Uses focused shared actions, purpose-specific workflow files, machine-distributed jobs, development-cycle events, and production-review boundaries.
What it assumes
Assumes familiarity with GitHub Actions actions, workflows, jobs, event types, and branching strategies.
What you can do after
Apply it via GitHub Actions by dividing automation into focused actions, workflows, and justified jobs.
How it connects
Connects single responsibility with SOLID principles, GitHub Actions, continuous integration, continuous delivery, branching strategy, and separation of duties.

Also explained in

Compare how 7 books explain single responsibility principle →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GitHub Actions in Action: Continuous integration and delivery for DevOps. The section links point to the parts of the book it draws on.