learn-github-for-builders-with-phoebe / Session 6 of 6
Learn GitHub for Builders with Phoebe · Session 6 of 6 · Tech track

Ship like a professional: releases, protection, and a repo you are proud of

Five sessions gave you the moves - snapshots, the daily loop, branches, conflicts, CI. This one turns habits into enforced rules. You cut a real release, lock main so broken code cannot land, auto-deploy on merge, and measure your my-project repo against the bar a senior engineer would set. This is graduation.

🟠 Stretch Builders & analysts Terminal or Codespaces 45 min live + self-study
0-3 · Welcome 3-16 · Concepts 16-40 · Build-along 40-45 · Q&A
Part 0

From good habits to enforced rules

Anyone can be careful on a good day. Professional repos are safe on a bad day - because the rules, not the humans, refuse to let a failing or unreviewed change reach main. Today you turn everything from Sessions 3-5 into machinery: a version tag becomes a downloadable release, a green check becomes a merge gate, a merge to main becomes an automatic deploy. Then you score your repo the way a reviewer would and pin it on your profile.

Live - presented in session Self-study - read after class ★ Build-along - type it in your terminal Running artifact: my-project, shipped properly
★ What you walk out with today A tagged v1.0.0 release with auto-generated notes on GitHub, a protected main that requires a PR + a passing CI check + one approval, an Actions workflow that deploys Pages on merge, and a graduation scorecard that tells you exactly where your repo stands against a professional bar.
Part 1 · mark a version

Tags, releases, and semver 5 min live

A commit hash is precise but meaningless to humans. A tag pins a friendly, permanent name - a version - to one commit. A GitHub Release turns that tag into something people can download, with notes describing what changed. Semantic versioning gives the number itself a meaning so anyone can read risk at a glance.

A tag pins a version name to one commit. semver makes the number mean something. c1 first cut new chart breaking v1.0.0 v1.1.0 v2.0.0 v 2 . 1 . 3 the three numbers, left to right: MAJOR breaking change - existing users must adapt (2.x → 3.0.0) MINOR new feature, backward compatible - safe to upgrade (2.1 → 2.2.0) PATCH bug fix only, no new surface - always safe (2.1.3 → 2.1.4)
🔍 Click to zoom - tags pin versions to commits; MAJOR.MINOR.PATCH tells you the risk before you read a line
LiveAnnotated tags and gh release create3 min▶
  • An annotated tag is the professional default. git tag -a v1.0.0 -m "..." stores a message, author, and date - a lightweight tag (git tag v1.0.0) stores only a name. Use annotated for anything you release.
  • Tags do not push by themselves. git push origin v1.0.0 (or --tags) sends them. Forgetting this is the number one "where is my release?" moment.
  • A Release is a tag with a face. gh release create v1.0.0 --generate-notes turns the tag into a GitHub Release page with a changelog built automatically from the PRs merged since the last tag - plus downloadable source archives.
# pin an annotated version to the current commit on main git tag -a v1.0.0 -m "First release" # tags do not travel with a normal push - send it explicitly git push origin v1.0.0 # turn the tag into a downloadable Release with auto notes from merged PRs gh release create v1.0.0 --generate-notes https://github.com/phoebefu6/my-project/releases/tag/v1.0.0
Self-studyWhich number moves? one line each2 min read▶
ChangeBumpExample
Breaking - existing use stops workingMAJOR1.4.2 → 2.0.0
Feature - new, backward compatibleMINOR1.4.2 → 1.5.0
Fix - bug patched, nothing newPATCH1.4.2 → 1.4.3

When MAJOR or MINOR bumps, the numbers to its right reset to zero. Auto-generated release notes group the merged PRs so the changelog writes itself - one more reason short, clear PR titles from Session 3 pay off.

Part 2 · make the rules real

Branch protection + CI as a gate 4 min live

Until now the green check from Session 5 was a suggestion - you could merge past a red one if you were reckless. Branch protection turns it into a gate. In Settings → Branches you add a rule for main that requires a PR, requires that CI check to pass, requires one approval, and forbids direct pushes. The habits become law.

A PR only reaches protected main after all three gates pass. Your PR Gate 1 1 approval Gate 2 CI is green Gate 3 up to date main Direct push to main rejected - no PR, no gates cleared a failing or unreviewed change simply cannot land
🔍 Click to zoom - protection makes the green check a gate, not a polite suggestion
LiveThe four rules that make main safe2 min▶
  • Require a pull request before merging. No pushing straight to main - every change arrives as a reviewable PR.
  • Require status checks to pass. Select your Session 5 CI job - a red run blocks the merge button entirely.
  • Require one approval. A second pair of eyes signs off before code lands. Pair with CODEOWNERS to auto-request the right reviewer.
  • Require the branch to be up to date. The PR must include the latest main, so checks run against what will actually merge.
Real world

This is how a professional repo protects production. A brand-new contributor on their first day literally cannot break main - they can open a PR, but the rules block the merge until CI is green and a maintainer approves. The safety comes from the configuration, not from everyone remembering to be careful. That is the whole point of protection.

Part 3 · close the loop

Deploy Pages via Actions + the pro-repo bar 4 min live

The non-tech track published a site by hand in Settings. Now you automate it: set the Pages source to GitHub Actions and add a deploy workflow, and every merge to main republishes the site on its own. That closes the loop - reviewed code becomes live product with no manual step. Around it sits the professional-repo bar: the handful of files and rules that make a reviewer trust your work.

# .github/workflows/deploy.yml - publish Pages on every push to main on: push: { branches: [main] } permissions: pages: write id-token: write jobs: deploy: runs-on: ubuntu-latest environment: github-pages steps: - uses: actions/checkout@v4 - uses: actions/upload-pages-artifact@v3 with: { path: "." } - uses: actions/deploy-pages@v4 merge to main → build → live site, no button to press
Self-studyCommunity-health files that make a repo welcoming2 min read▶
  • CONTRIBUTING.md - how to set up, branch, and open a PR here. It answers the first question every new contributor has, once.
  • Issue and PR templates - .github/ISSUE_TEMPLATE/ and PULL_REQUEST_TEMPLATE.md prompt for the details you always end up asking for anyway.
  • Dependabot - a .github/dependabot.yml file opens automatic PRs to bump vulnerable dependencies, so security upkeep runs itself.
The professional-repo checklist, as a concept README, a license, CI on every PR, protected main, tagged releases, CONTRIBUTING, and issue templates. You do not need all of them on day one - but a reviewer scans for them in seconds, and each present row raises how much they trust the repo.
Build-along 1 of 3

Cut a release ★ 8 min · everyone tags

On your my-project repo, make sure you are on an up-to-date main: git switch main && git pull.

Tag this commit as your first version: git tag -a v1.0.0 -m "First release", then push the tag: git push origin v1.0.0.

Turn the tag into a Release with auto notes: gh release create v1.0.0 --generate-notes. Open the URL it prints and read the changelog built from your merged PRs.

Discuss out loud: if your next change removed a feature people rely on, what version would it be? (Answer: v2.0.0 - a MAJOR bump.)

Build-along 2 of 3

Protect main ★ 7 min · everyone locks

On GitHub, go to Settings → Branches → Add branch ruleset (or classic Add rule) and target main.

Turn on: Require a pull request before merging, Require status checks to pass (select your Session 5 CI job), and Require 1 approval. Save.

Now try to break the rule: git switch main, make a tiny edit, commit, and git push. Watch GitHub reject it - the push is refused because main now requires a PR.

Sit with that for a second. Feel the safety: from now on, nothing reaches main without a review and a green check. That is a protected branch.

If the push succeeded The ruleset either did not save or targets the wrong branch name. Re-open Settings → Branches and confirm the pattern is exactly main and the rule is enabled.
Build-along 3 of 3

The graduation scorecard ★ 6 min · everyone scores

Six sessions in one widget. Tick every row your my-project repo genuinely has and read the verdict - it is the exact list a reviewer runs down before they trust a repo.

After the session

Your graduation lap ◐ one real project

Check yourself

Three questions before you graduate 🎯 ◐ 90 seconds

1 · Your change removes a feature other people depend on. Which part of the semver number bumps?

MAJOR means "existing users must adapt". Removing something they rely on breaks them, so 1.x becomes 2.0.0. MINOR is for backward-compatible features; PATCH is bug-fix-only.

2 · With branch protection requiring a PR, an approval, and a passing check, what can no longer happen?

Protection blocks direct pushes and holds the merge button until the checks pass and a reviewer approves. Merging still happens - only unsafe merges are stopped.

3 · What does cutting a Release add over a plain git tag?

A tag is just a name on a commit. gh release create --generate-notes turns it into a GitHub Release page with an auto-built changelog and downloadable source archives.

Source material

Coverage - the whole track, and what is deliberately next

Session 6 closes the tech track. Here is what today covered, what is self-study, and what is left for future courses on purpose.

✓Introduction to Git - tagsannotated tags pin versions to commits - Part 1 + Build-along 1
✓GitHub Pages - deploy via ActionsPages source = Actions; merge to main auto-publishes - Part 3
✓Branch protection + required checksPR + green CI + approval as an enforced gate - Part 2 + Build-along 2
✓Releases + semvergh release create --generate-notes; MAJOR.MINOR.PATCH - Part 1
◐CONTRIBUTING / templates / Dependabotthe community-health files - self-study card
✗Copilot / CodeQL / supply-chainnot covered by design - future AI + security courses

Session 6 cheat sheet · pin this

Tag a versiongit tag -a v1.0.0 -m "..." then git push origin v1.0.0. Tags do not auto-push.
Cut a releasegh release create v1.0.0 --generate-notes - notes + downloads from your merged PRs.
semverMAJOR = breaking · MINOR = new feature (compatible) · PATCH = bug fix. Read risk from the number.
Protect mainSettings → Branches: require PR + status checks (your CI) + 1 approval. Green becomes a gate.
Auto-deployPages source = GitHub Actions + a deploy workflow → merge to main republishes on its own.
The pro barREADME · license · CI · protected main · releases · CONTRIBUTING · templates. Reviewers scan for these.