Professional GitHub Workflows
6 learning objectives · 10 key terms · 7 commands · 3 diagrams · 5 quiz questions
Professional GitHub Workflows
Professional PracticeWhat you'll be able to do
- Choose naming conventions for branches and commits that survive a year of history
- Add pull request and issue templates that raise the quality of every contribution
- Use CODEOWNERS to route reviews automatically
- Apply semantic versioning and maintain a changelog people actually read
- Structure a monorepo with ownership and per-path CI
- Define team permissions and repository governance that scales
The idea, in plain language
A repository that works for one person starts costing the team around the fifth contributor. The symptoms are always the same: branches named after people, commits that say "fix", pull requests with empty descriptions, no one clearly responsible for a directory, and releases that happen whenever somebody remembers. None of that is caused by Git — it is caused by conventions that were never written down. The professional move is to encode the conventions in the repository itself, so they apply automatically rather than being re-litigated in every review.
The tools for that are all files and settings. Naming conventions (feature/…, fix/…, and commit types like feat, fix, docs, refactor, test, chore) make history filterable. A pull request template makes every description answer the same useful questions, and an issue template stops bug reports arriving without reproduction steps. CODEOWNERS automatically requests the right reviewers for each path, which is how a large repository stays reviewable. Tools such as commitlint or a workflow check can enforce the conventions you care about, which is far more reliable than reminding people.
Release discipline completes the picture: semantic versioning that reflects what actually changed, a changelog generated from conventional commits or merged pull request titles, and a single documented way to cut a release. Permissions and governance are the final layer — team roles, branch protection, required reviews for sensitive paths, and a written decision for who can push to main. The test of all of it is simple: a new contributor should be able to open a worthy pull request on their first day without asking a single person how.
Key terms
- Branch naming convention
- A predictable scheme such as feature/login-form or fix/101-session-timeout.
- Conventional commits
- A message format — type(scope): subject — that tools can parse into changelogs.
- Pull request template
- .github/pull_request_template.md, which pre-fills every new description.
- Issue template
- A YAML form or Markdown template in .github/ISSUE_TEMPLATE/.
- CODEOWNERS
- A file mapping paths to owners, used to request the right reviewers automatically.
- Changelog
- A human-readable record of what changed in each release, usually generated from commit or PR titles.
- Monorepo
- One repository containing multiple projects or packages.
- Repository role
- Permission level for a person: read, triage, write, maintain or admin.
- Governance
- Written rules for decisions, releases and who may change what.
- Release train
- A fixed, predictable release schedule rather than ad-hoc releases.
How it works, step by step
- 1Write the conventions into the repository
A CONTRIBUTING.md that states branch names, commit format, how to run tests and what a good pull request looks like. If it only lives in someone’s head, it does not exist.
CONTRIBUTING.mdmarkdown# Contributing ## Branches feature/<slug>, fix/<issue>-<slug>, docs/<slug>, chore/<slug> ## Commits feat:, fix:, docs:, refactor:, test:, chore: — imperative subject under 50 chars ## Pull requests One change per PR, description follows the template, tests must pass locally
- 2Add templates so quality is the default
A pull request template turns every description into a useful one, and an issue form collects the details a bug report needs. Put them in .github/ and they apply automatically.
.github/pull_request_template.mdmarkdown## What ## Why (linked issue) Closes # ## How I verified it - [ ] tests added or updated - [ ] ran the suite locally ## Reviewer notes
- 3Route reviews with CODEOWNERS
Map directories to teams so the right reviewers are requested on every change, and combine it with branch protection to require code-owner approval for sensitive paths.
CODEOWNERSmarkdown# .github/CODEOWNERS * @ada /infra/ @ada @platform-team /api/ @backend-team /docs/ @docs-team
- 4Adopt conventional commits and generate the changelog
One format everyone can follow, validated in CI, then parsed for release notes. The rule that matters most is that the type describes the effect on users.
commit formatbashfeat(auth): add session refresh endpoint fix(export): handle empty tables without crashing docs(readme): correct the install command refactor(parser): extract tokeniser chore(deps): bump lodash to 4.17.21
- 5Make releases predictable
A release train — a versioned release every two weeks, for example — removes the debate about when to release. Announce the process, automate the artefact production, and keep the changelog generated rather than handwritten.
releasebashgh release create v2.5.0 --generate-notes --latest
- 6Set permissions and protect the important branches
Give contributors the lowest role that works, protect main with required reviews and checks, require code-owner review for sensitive paths, and keep an admin list deliberately short.
governance in one callbashgh api --method PUT repos/:owner/:repo/branches/main/protection \ -f required_status_checks[strict]=true \ -f required_pull_request_reviews[require_code_owner_reviews]=true
Commands worth memorising
Every block below is copy-ready — use the Copy button, then paste it into your terminal. Expected output is shown underneath so you know what “working” looks like.
git log --oneline -10
a1b2c3d feat(auth): add session refresh endpoint e4f5a6b fix(export): handle empty tables c7d8e9f docs(readme): correct the install command
If the log does not read as a list of intentions, the convention is not yet working.
git config commit.template .gitmessageA .gitmessage file with the type list in comments nudges every author towards the same format without enforcement.
git shortlog -sn --no-merges
42 Ada Lovelace
17 Grace HopperA quick view of contribution distribution, useful before a release retrospective.
git log --pretty="- %s (%h)" v2.4.1..v2.5.0
- feat: add session refresh endpoint (a1b2c3d) - fix: handle empty tables in export (e4f5a6b)
Conventional commit subjects make this list readable enough to paste straight into CHANGELOG.md.
gh api --method PUT repos/:owner/:repo/branches/main/protection -f required_pull_request_reviews[require_code_owner_reviews]=true
Works only once .github/CODEOWNERS is on the default branch and the owners have write access.
gh api repos/:owner/:repo/collaborators --jq '.[] | "\(.login) \(.permissions.push | tostring)"'
ada true grace true
Review this list before a security questionnaire: an admin list nobody recognises is the usual finding.
gh release create v2.5.0 --generate-notes --latest
A predictable tag every cycle removes the recurring debate about when to ship.
Workflow diagrams
| File | Location | What it makes automatic |
|---|---|---|
| Pull request template | .github/pull_request_template.md | Every description answers the same useful questions |
| Issue templates | .github/ISSUE_TEMPLATE/*.yml | Bug reports arrive with reproduction steps |
| CODEOWNERS | .github/CODEOWNERS | The right reviewers are requested for each path |
| Contributing guide | CONTRIBUTING.md | Branch, commit and testing rules are discoverable |
| Changelog | CHANGELOG.md | Release summaries are generated, not remembered |
| Security policy | SECURITY.md | Researchers know how to report a vulnerability privately |
| Workflows | .github/workflows/*.yml | Tests, lint and checks run without being asked |
Each file replaces a rule that would otherwise have to be remembered and repeated in review.
- Anything a reviewer has to say twice should become a file.
- Start with the pull request template and CODEOWNERS — they pay back immediately.
- Keep the set small; seven files everybody reads beat twenty nobody does.
| Role | Can do | Give it to |
|---|---|---|
| Read | View and clone | Auditors, stakeholders, most consumers |
| Triage | Manage issues and pull requests, no code push | Community managers and support |
| Write | Push branches and merge allowed pull requests | Regular contributors and maintainers |
| Maintain | Manage the repository without destructive settings | Senior maintainers, release managers |
| Admin | Everything, including settings and visibility | A deliberately small number of people |
Least privilege applied to people, not just tokens. Most contributors only ever need write.
- Start contributors at read or triage and promote on demonstrated need.
- Keep the admin list short enough to name from memory.
- Protect main so that write access still cannot bypass review.
| Helpful | Unhelpful |
|---|---|
| Explain the risk and suggest a concrete alternative | "This is wrong" |
| Mark severity — blocker versus nit: | Treating every remark as mandatory |
| Ask a question when intent is unclear | Assuming the author was careless |
| Approve promptly when it is good enough | Withholding approval to make a point |
| Comment on the code, never the person | Sarcasm, however mild |
| Review the description first, then the diff | Reading the diff cold and guessing the purpose |
Reviews are the main way standards travel through a team, so the tone matters as much as the content.
- Separate blockers from preferences explicitly, so the author knows what must change.
- Review the intent (the description and linked issue) before the implementation.
- Aim to unblock: an approving review that lands today beats a perfect review that lands next week.
Worked example
The pull request description a team convention produces, written once and reused for every change.
## What Adds session refresh so an active user is not logged out at the idle timeout. ## Why Closes #128. Users were losing form data when the 30-minute idle window expired mid-edit. ## How I verified it - [x] Added unit tests for refresh at 29 and 31 minutes - [x] Ran npm test locally (52 passing, 0 failing) - [x] Manually verified with a 31-minute idle session ## Reviewer notes The refresh endpoint reuses the existing token signing path, so no new secrets are required. I deliberately did not change the idle timeout itself — that is a separate discussion in #130. ## Risk and rollback Low: the endpoint is additive. Rollback is re-deploying tag v2.4.1.
A reviewer can decide in two minutes: what changed, why, how it was tested, what was intentionally left out, and how to undo it.
Where you'll use it
Common mistakes
- Writing conventions in a wiki that nobody reading a pull request will ever see.
- Creating twenty issue templates so contributors pick the wrong one out of confusion.
- Making CODEOWNERS so broad that every change requires three approvals, which kills the review queue.
- Letting commit message formats become a personal preference instead of a team decision enforced by CI.
- Hand-maintaining a changelog, which guarantees it will be out of date.
- Giving admin access to everyone because roles felt like bureaucracy.
- Treating every review comment as a blocker, so a small change takes two weeks.
Best practices
- Encode conventions as files in the repository, and enforce the important ones in CI.
- One pull request, one purpose, with a description that answers what, why and how verified.
- Use conventional commits if you want generated changelogs and semantic version bumps.
- Keep CODEOWNERS per-directory but keep required approvals low enough that reviews actually happen.
- Set repository roles by least privilege and keep the admin list short.
- Release on a predictable cadence and generate the notes.
- Model the review tone you want to receive: specific, kind, and unblocking.
Hands-on exercise
Turn a personal repository into a team-ready one
Seven files and a settings pass that make a repository self-explanatory.
- Write a CONTRIBUTING.md stating branch naming, commit format, how to run tests and the pull request expectations.
- Add .github/pull_request_template.md with What, Why, How verified, Reviewer notes and Risk/Rollback sections.
- Add a bug report issue form under .github/ISSUE_TEMPLATE/ that asks for expected versus actual behaviour, steps to reproduce and environment.
- Add .github/CODEOWNERS mapping at least two paths to owners, then open a pull request touching one of them and confirm the reviewer is requested automatically.
- Add a CHANGELOG.md and one release entry, then create a matching tag and release with generated notes.
- Review the repository roles of your collaborators (or organisation members) and write, in a short GOVERNANCE.md, who may merge to main and how a release is approved.
💡 Hint: CODEOWNERS only takes effect once the file is on the default branch, and the reviewer must have write access for the request to be meaningful.
Done when: A new contributor could read CONTRIBUTING.md, open a pull request against your template, and get the correct reviewer requested without asking anyone.
Checkpoint quiz
0 of 5 answered · 0 correct
- Multiple choiceQ1
What is the main purpose of CODEOWNERS?
- Multiple choiceQ2
Which commit message follows the conventional commits format?
- TroubleshootingQ3
A contributor keeps opening pull requests with empty descriptions, and reviewers keep asking the same questions. What is the most effective fix?
- True or falseQ4
True or false: giving every contributor the admin role simplifies repository management.
- Multiple choiceQ5
Why is a release train useful?
Module summary
- Encode conventions as files in the repository: CONTRIBUTING, templates, CODEOWNERS, CHANGELOG, workflows.
- Conventional commits make changelogs and version bumps automatic.
- CODEOWNERS routes reviews and, with branch protection, can require the right approval.
- Give each person the lowest role that works, and keep the admin list short.
- A release train plus generated notes removes the recurring release debate.
- Review the intent before the diff, mark blockers versus nits, and aim to unblock.
- The test of a professional repository: a new contributor can contribute correctly on day one without asking.
Recommended resourcesAffiliate links · may earn us a commission
Recommended for learners
Practice what you learned
Put the GitHub course to work: open one of the company-wise repositories and follow the workflow you just learned, branch to release.