Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 6Name in the course: GitHub collaboration

Work with GitHub pull requests

On GitHub, every change goes through a pull request (PR): a branch, a description, automatic checks, a review, then a merge. This is how teams keep main safe — and how infrastructure changes get reviewed before they touch production.

  • 5 Lessons
  • 2 Commands

$ run as a normal user# run as root (or with sudo)

6.1

Follow the GitHub flow

Branch → commits → push → pull request → checks and review → merge → delete branch.

git switch -c fix/nsg-ssh
git commit -am "Close SSH to the internet"
git push -u origin fix/nsg-ssh
gh pr create --title "Close SSH to the internet" --body "Only Bastion may reach port 22."
gh pr checks
gh pr view --web
gh pr merge --squash --delete-branch

Commands in this lesson

6.2

Write a good pull request

A reviewer must understand the why and the risk in one minute.

  • Title: what changes, in one line.
  • Body: why, how it was tested, the risk, and for infrastructure: the plan output (what will be created, changed, destroyed).
  • Keep it small: one topic per PR.
  • Link the issue: Fixes #12 closes the issue when merged.

6.3

Review changes

Review the logic, the security and the tests — not only the style.

gh pr checkout 42
gh pr diff 42
gh pr review 42 --approve
gh pr review 42 --request-changes --body "The NSG still allows 0.0.0.0/0 on 3389."
Look forExample
SecretsKeys, passwords, tokens in code or config
Destroys-/+ or - on databases and disks in a Terraform plan
Wide access0.0.0.0/0, * actions, Owner roles
Missing testsNew code without a check in the pipeline

Commands in this lesson

6.4

Protect the main branch

Branch protection rules (or rulesets) force the flow: no direct pushes, required reviews and required checks.

Settings → Rules → Rulesets → New branch ruleset:

  • Target: main.
  • Require a pull request before merging, with at least 1 approval.
  • Require status checks to pass (for example terraform-plan, lint, security-scan).
  • Block force pushes and deletions.
  • Require signed commits (optional, see Secure your Git work).
  • CODEOWNERS review for sensitive folders.
.github/CODEOWNERS
/envs/prod/   @s0sta
/modules/     @s0sta

6.5

Use issues and releases

Issues track work and bugs; releases mark versions with notes and files.

gh issue create --title "Rotate storage keys" --label security
gh issue list --label security
git tag -a v1.3.0 -m "Staging on Azure"
git push origin v1.3.0
gh release create v1.3.0 --generate-notes

Commands in this lesson

All commands in this chapter