MSBA-308 · Lesson 10 of 12 · 19 min
Hands-on practice
▶ Video coming soon A video version of this lesson is on the way.
On Wednesday of the third week Priya handed Lena a sheet of twelve labs. "Reading builds recognition," she said. "Doing builds recall. The exam needs both, and the things you have only read about are the things you will hesitate on." Lena worked through the labs over two afternoons in a test organization Priya had created for the purpose, separate from Tidewater's real repositories, so nothing she broke would matter. This lesson describes the labs and what each one practises. Every lab maps to bullets in the outline and to the ones and twos in Lena's spreadsheet.
Setting up a practice space
A safe practice space needs three things: an organization where you are an owner, so you can change Actions policies; a few repositories, at least one public and one private, so you can see how visibility changes behaviour; and a place for a self-hosted runner, such as a small virtual machine or a container on your own computer. A free organization is enough for most labs. Labs that need features of paid plans, such as environment reviewers on private repositories or larger runners, can be done on public repositories or read about instead.
The twelve labs
| Lab | What to do | Domain |
|---|---|---|
| 1. Typed inputs | Build a workflow_dispatch form with string, choice and boolean inputs; branch on the boolean using the inputs context | Authoring |
| 2. Reusable workflow | Call a reusable workflow from the .github repository with inputs, one mapped secret, and an output read by a later job | Authoring |
| 3. Service container | Run tests against a Postgres service with a health check | Authoring |
| 4. Dynamic matrix | Build a matrix from a JSON output with fromJSON; add include and exclude; rerun one failed variant | Authoring and troubleshooting |
| 5. Anchors | Refactor a file with repeated env blocks to use an anchor and a merge key; predict, then check, the expanded values | Authoring and troubleshooting |
| 6. Debugging | Break a workflow three ways (filter, permission, missing secret on a fork) and diagnose each from logs alone | Troubleshooting |
| 7. Templates | Publish a workflow template from a non-public .github repository; use it in a new repository; disable and re-enable a workflow | Troubleshooting |
| 8. Three actions | Write a tiny composite action, a JavaScript action on node24 and a Docker action; run the Docker one on a Windows runner and read the error | Actions |
| 9. Release | Release v1.0.0 and v1.1.0 of an action as immutable releases, move a v1 tag, and consume it by SHA | Actions |
| 10. Runner group | Register a self-hosted runner with a custom label in its own group limited to one repository and one workflow | Enterprise |
| 11. Policies and secrets | Set allowed actions with a pattern and a block, require SHA pinning, then set an organization secret limited to one repository with gh secret set | Enterprise and security |
| 12. Secure deploy | Replace a stored key with OIDC to a test cloud account, add an environment, generate an attestation and verify it | Security |
Each lab takes 15 to 30 minutes. The point is not to build anything polished; it is to see each feature behave once, including the errors. Lena kept a short note for each lab with one line on what she expected and one on what actually happened. Three of her notes recorded surprises, and all three became flash cards.
Lab 4 in detail: a dynamic matrix
The dynamic matrix lab practises several bullets at once: outputs between jobs, expressions, fromJSON and matrix troubleshooting.
jobs:
plan:
runs-on: ubuntu-latest
outputs:
regions: ${{ steps.list.outputs.regions }}
steps:
- id: list
run: echo 'regions=["fundy","highlands","valley"]' >> "$GITHUB_OUTPUT"
build:
needs: plan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
region: ${{ fromJSON(needs.plan.outputs.regions) }}
steps:
- run: echo "Building ${{ matrix.region }}"Lena predicted three build jobs, named build (fundy), build (highlands) and build (valley), and that is what appeared. She then made the valley job fail on purpose. With fail-fast off, the other two finished. She reran only the failed job from the run page and checked that the new attempt appeared in the history beside the first one. Then she broke the JSON by leaving out a closing bracket and read the error the fromJSON call produced, so that she would recognize it on a log excerpt.
Lab 6 in detail: diagnosing from logs alone
The debugging lab is the most useful practice for the troubleshooting domain because it forces you to use evidence rather than memory. Priya broke three workflows while Lena was out of the room, and Lena had to find each cause using only the run pages and logs.
Worked problem
Three breaks, three causes
Workflow A did not run on a push. Workflow B failed with "Resource not accessible by integration". Workflow C ran from a fork pull request and a step that uploads a report failed with an authentication error. What were the causes?
Show solution
- A: no run appeared at all, so Lena checked the trigger. Priya had added a paths filter that excluded the folder Lena changed.
- B: the Set up job section listed contents: read only. Priya had replaced the job's permissions key with one that omitted the write permission the step needed.
- C: the run came from a fork, so the token was read-only and secrets were empty. That was by design; the fix was to move the upload into a separate workflow that does not run the fork's code.
Answer: A path filter, a missing job permission, and the intended restrictions on fork pull requests.
Lab 12 in detail: a secure deployment
The last lab brings the security domain together. Lena started from a workflow that deployed static files to a cloud storage bucket using an access key stored as a secret. She added an OIDC trust in the test cloud account that accepted only tokens for the lab repository and the production environment, gave the job id-token: write, and removed the stored key. She added an environment called production with a deployment branch rule for main. She added an attestation step for the built archive with id-token and attestations permissions, and a verify step with gh attestation verify before upload. On the public lab repository she also added herself as a required reviewer, which the Team plan allows for public repositories, and watched the job wait for her approval.
Two things went wrong on the first try, which is why labs matter. The cloud rejected the OIDC token because the trust policy checked for the branch while the job was deploying through an environment, so the subject claim named the environment instead. And the attestation step failed until she added attestations: write. Both mistakes are classic exam distractors, and now she had made them herself.
Using the exam sandbox
Alongside the labs, Lena spent twenty minutes in the GitHub exam sandbox linked from the certification page. It contains no real questions, but it shows how each question style is answered, how flagging for review works, how the review screen lists answered and unanswered questions, and where the timer sits. She practised flagging three questions and returning to them, so the motion would be automatic on the day.
When labs are not possible
Some outline bullets need features you may not have, such as an enterprise account, larger runners with static IPs or an IP allow list. For these, the next best thing is to read the documentation page closely and work through its examples on paper: draw the settings at each level, write the YAML, and predict what would happen. Lena did this for IP allow lists and private networking for hosted runners, and asked Yevgenia to show her Skerry's settings pages during their call.
Lab 2 in detail: a reusable workflow
Reusable workflows are tested in two domains, so Lena gave the lab extra time. She wrote a deployment workflow in the organization's .github repository with on: workflow_call, two inputs, one required secret and one output. Then she called it from lab-public and read the run page, where the called workflow's jobs appear nested under the caller's job.
# In tidewater-lab/.github: .github/workflows/deploy.yml
on:
workflow_call:
inputs:
target:
type: string
required: true
secrets:
deploy-key:
required: true
outputs:
url:
value: ${{ jobs.ship.outputs.url }}
jobs:
ship:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.go.outputs.url }}
steps:
- id: go
run: echo "url=https://${{ inputs.target }}.example.test" >> "$GITHUB_OUTPUT"
# In lab-public: .github/workflows/release.yml
jobs:
deploy:
uses: tidewater-lab/.github/.github/workflows/deploy.yml@v1
with:
target: staging
secrets:
deploy-key: ${{ secrets.STAGING_KEY }}
report:
needs: deploy
runs-on: ubuntu-latest
steps:
- run: echo "Deployed to ${{ needs.deploy.outputs.url }}"Three things surprised her. The output had to be declared at three levels: the step, the job inside the called workflow and the workflow_call block. The calling job could not have steps or runs-on of its own, because the called workflow supplies its jobs. And when she tried secrets: inherit instead of the mapping, it worked, but passed every secret the caller could see, which is convenient within an organization and broader than this workflow needed. She logged the three-level output chain as a flash card.
Keeping a lab log
Lena's lab notes followed a fixed format, which made them quick to review later. Each entry had the lab number, the outline bullet, what she predicted, what happened and, where they differed, the reason. A typical entry read: lab 8, Docker action on Windows; predicted a clear error about the platform; got a job failure explaining that container actions need a Linux runner; matches. Another read: lab 11, organization secret limited to one repository; predicted the other repository would fail with an empty value; the step ran and printed nothing, with no error, because a missing secret is an empty string. That second entry became one of her most useful flash cards, because exam questions about missing secrets often describe exactly that silence rather than an error.
Cleaning up
When the labs were finished, Lena removed the self-hosted runner from its group and deleted the virtual machine, revoked the OIDC trust in the test cloud account and deleted the test organization's secrets. Leaving practice credentials and runners in place is a small risk that is easy to avoid, and the tidy-up itself practised several enterprise tasks one more time.
Lab 10 in detail: a runner group
The runner group lab covers several enterprise bullets in half an hour. Lena registered a self-hosted runner on a small virtual machine with the custom label docs-builder, created a runner group in the test organization, set it to allow only lab-private and only one workflow file in that repository, and moved the runner into it. She then wrote a job with runs-on listing self-hosted and docs-builder, ran it from lab-private, and watched it start. From lab-public, the same job sat waiting with a message that no runner matched its labels, because the group did not allow that repository.
Next she ran the job from a second workflow file in lab-private. It also waited, because the group was limited to the first workflow. This was the behaviour she most wanted to see: a job that is permitted by labels but not by group settings does not fail; it waits until it times out or is cancelled. On the exam, a description of a job queued for a long time with no error is a strong hint about runner group access or labels.
Lab 11 in detail: policies
The policy lab was quick but revealing. Lena set the organization to allow only actions created by GitHub and a selected list, added one Marketplace action by its full name with a version pattern, and turned on the requirement for full-length SHA pinning. A workflow that used a tag reference then failed before any job started, with a message naming the action that was not pinned. A workflow that used a local action with a ./ path still ran, since the pinning rule applies to actions from other repositories. She also added a blocking entry with an exclamation mark for one action and confirmed that it failed even though the wider pattern would otherwise have allowed it.
Lena's final lab note was a single page listing every flash card the labs had produced, sorted by domain. There were eleven cards, and she noticed that eight of them came from labs that had gone wrong on the first attempt. That was Priya's point exactly: the mistakes made in a safe test organization were the ones least likely to be repeated on the exam.
Common mistakes
MistakePractising in a real organization's repositories.
InsteadUse a separate test organization where breaking things is safe.
MistakeOnly doing labs that succeed.
InsteadBreak things on purpose and read the errors; the exam shows you errors.
MistakeSkipping features your plan lacks.
InsteadUse public repositories where that unlocks them, or study the documentation and predict on paper.
MistakeLeaving the exam interface until exam day.
InsteadTry the sandbox to practise flagging and review.
By Thursday evening Lena's spreadsheet had no ones left, and only four twos, all in areas she could not practise without an enterprise account. She retook the practice assessment and scored 86, with every domain above the line.
Summary and key terms
- Use a separate test organization with public and private repositories and a self-hosted runner.
- Twelve short labs cover the practical bullets across all five domains.
- Predict the result, then check it; record surprises as flash cards.
- Break workflows on purpose and diagnose them from logs alone.
- A secure deployment lab brings together OIDC, environments and attestations.
- Practise the exam interface in the sandbox, and study unavailable features on paper.
- Test organization
- A separate GitHub organization used for practice so experiments cannot affect real work.
- Lab
- A short hands-on task tied to specific outline bullets.
- Prediction
- Writing down what you expect before running something, so surprises are noticed.
- Exam sandbox
- A demonstration of the exam interface with no real questions.
- Trust policy
- The cloud-side rule that decides which OIDC tokens are accepted.
- Deliberate break
- An error introduced on purpose to practise diagnosis.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why might a cloud reject an OIDC token after a job starts using an environment?
Show answer
The subject claim then names the environment, which the trust policy may not accept.
What does lab 4 practise besides matrices?
Show answer
Job outputs, needs, expressions and fromJSON.
How can you practise environment reviewers on the Team plan?
Show answer
Use a public repository, where Team supports required reviewers.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.