Skip to content

Commit b278230

Browse files
GeekTrainerCopilot
andcommitted
Fix GitHub Actions workshop content issues
Code: - seed_database.py now respects DATABASE_PATH env var (matches app.py pattern) Factual fixes: - Fix reusable workflow nesting limit: 10 → 4 levels (8-reusable-workflows.md) - Add cache: 'pip' to composite action setup-python step (7-custom-actions.md) - Clarify secrets vs variables distinction in reusable workflows example Content cleanup: - Fix Ctl → Ctrl typo across 8 files - Fix 'Then caller' → 'The caller' typo (8-reusable-workflows.md) - Fix URL path: using-workflows → writing-workflows (5-matrix-strategies.md) - Fix misleading [marketplace] link label → [caching] in README - Rewrite 4-caching.md intro to lead with caching, not marketplace - Clarify 'code scanning workflow' next step (9-required-workflows.md) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d11f050 commit b278230

10 files changed

Lines changed: 22 additions & 19 deletions

File tree

app/server/utils/seed_database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def create_app():
1919
# Get the server directory path (one level up from utils)
2020
server_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
2121

22-
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{os.path.join(server_dir, "dogshelter.db")}'
22+
db_path = os.environ.get('DATABASE_PATH', os.path.join(server_dir, 'dogshelter.db'))
23+
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{db_path}'
2324
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
2425

2526
# Initialize the database with the app

content/github-actions/1-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Let's start with the classic "Hello World" — a workflow you can trigger manual
6868

6969
Now let's push the workflow and trigger it by hand.
7070

71-
1. Open the terminal in your codespace by pressing <kbd>Ctl</kbd>+<kbd>`</kbd>.
71+
1. Open the terminal in your codespace by pressing <kbd>Ctrl</kbd>+<kbd>`</kbd>.
7272
2. Stage and commit your changes:
7373

7474
```bash

content/github-actions/3-running-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ The **`permissions`** block controls what this token can do. For our CI workflow
101101

102102
A bit later you'll use a more standard branching approach for changes. But for our purposes right now, let's push straight to `main`. What you'll notice is the workflow will automatically run, since the workflow will now exist on `main`!
103103

104-
1. Open the terminal in your codespace by pressing <kbd>Ctl</kbd>+<kbd>`</kbd>, then stage, commit, and push:
104+
1. Open the terminal in your codespace by pressing <kbd>Ctrl</kbd>+<kbd>`</kbd>, then stage, commit, and push:
105105

106106
```bash
107107
git add .github/workflows/run-tests.yml

content/github-actions/4-caching.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
| [← Running Tests][walkthrough-previous] | [Next: Matrix Strategies & Parallel Testing →][walkthrough-next] |
44
|:-----------------------------------|------------------------------------------:|
55

6-
The [GitHub Actions Marketplace][actions-marketplace] is a collection of pre-built actions created by GitHub and the community. Actions can set up tools, run tests, deploy code, send notifications, and much more. Rather than writing everything from scratch, you can leverage the work of thousands of developers.
6+
**Caching** is a technique to speed up your workflows by reusing previously downloaded dependencies instead of fetching them from the internet on every run. This exercise teaches you how to cache Python packages and Node modules so your CI pipeline stays fast as your project grows.
77

8-
In this exercise you'll also learn about **caching** — a technique to speed up your workflows by reusing previously downloaded dependencies instead of fetching them from the internet on every run.
8+
Along the way you'll also browse the [GitHub Actions Marketplace][actions-marketplace] — a collection of pre-built actions created by GitHub and the community that you can drop into any workflow.
99

1010
## Scenario
1111

@@ -71,7 +71,7 @@ The e2e job has two dependencies to cache — Python packages and the Node modul
7171

7272
Now let's push the changes and see the impact of caching.
7373

74-
1. In the terminal (<kbd>Ctl</kbd>+<kbd>`</kbd> to toggle), stage, commit, and push your changes:
74+
1. In the terminal (<kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle), stage, commit, and push your changes:
7575

7676
```bash
7777
git add .github/workflows/run-tests.yml

content/github-actions/5-matrix-strategies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Let's update the CI workflow to test the API across multiple Python versions.
5252
> [!IMPORTANT]
5353
> Make sure to quote version numbers like `'3.12'` in the matrix array. Without quotes, YAML may interpret them as floating-point numbers — for example, `3.10` becomes `3.1`, which would cause the setup step to fail.
5454

55-
5. In the terminal (<kbd>Ctl</kbd>+<kbd>`</kbd> to toggle), stage, commit, and push your changes:
55+
5. In the terminal (<kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle), stage, commit, and push your changes:
5656

5757
```bash
5858
git add .github/workflows/run-tests.yml
@@ -126,6 +126,6 @@ Matrix strategies let you test across multiple configurations — language versi
126126
|:-----------------------------------|------------------------------------------:|
127127

128128
[matrix-docs]: https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
129-
[strategy-syntax]: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategy
129+
[strategy-syntax]: https://docs.github.com/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategy
130130
[walkthrough-previous]: 4-caching.md
131131
[walkthrough-next]: 6-deploy-azure.md

content/github-actions/6-deploy-azure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ There are several strategies for ensuring only validated code reaches production
3030

3131
Let's set up the Azure Developer CLI and scaffold the infrastructure for our project.
3232

33-
1. Open the terminal in your codespace (or press <kbd>Ctl</kbd>+<kbd>`</kbd> to toggle it).
33+
1. Open the terminal in your codespace (or press <kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle it).
3434
2. Install azd by running:
3535

3636
```bash

content/github-actions/7-custom-actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Inputs and outputs let the action communicate with the calling workflow, making
2929

3030
Let's create a composite action that sets up Python, installs dependencies, and seeds the test database.
3131

32-
1. In your codespace, open a terminal window by selecting <kbd>Ctl</kbd>+<kbd>\`</kbd>.
32+
1. In your codespace, open a terminal window by selecting <kbd>Ctrl</kbd>+<kbd>\`</kbd>.
3333
2. Create the directory for the action by executing the following command in the terminal:
3434

3535
```bash
@@ -65,7 +65,7 @@ Let's create a composite action that sets up Python, installs dependencies, and
6565
uses: actions/setup-python@v5
6666
with:
6767
python-version: ${{ inputs.python-version }}
68-
68+
cache: 'pip'
6969
- name: Install dependencies
7070
run: pip install -r app/server/requirements.txt
7171
shell: bash
@@ -214,7 +214,7 @@ Now let's update the CI workflow to use the custom action instead of the individ
214214
DATABASE_PATH: ${{ steps.seed.outputs.database-file }}
215215
```
216216

217-
6. In the terminal (<kbd>Ctl</kbd>+<kbd>`</kbd> to toggle), commit and push your changes:
217+
6. In the terminal (<kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle), commit and push your changes:
218218
219219
```bash
220220
git add .github/actions/setup-python-env/action.yml .github/workflows/run-tests.yml

content/github-actions/8-reusable-workflows.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A **composite action** combines multiple *steps* into a single step that runs in
2525
| **Runner control** | Runs on the caller job's runner | Each job specifies its own runner |
2626
| **Secrets** | Cannot access secrets directly | Can receive secrets via `secrets:` or `secrets: inherit` |
2727
| **Logging** | Appears as one collapsed step in the log | Every job and step is logged individually |
28-
| **Nesting depth** | Up to 10 composite actions per workflow | Up to 10 levels of workflow nesting |
28+
| **Nesting depth** | Up to 10 composite actions per workflow | Up to 4 levels of workflow nesting |
2929
| **Marketplace** | Can be published to the [Actions Marketplace][actions-marketplace] | Cannot be published to the Marketplace |
3030

3131
**When to use which:**
@@ -69,7 +69,7 @@ on:
6969
required: true
7070
```
7171
72-
Then caller then passes each secret explicitly:
72+
The caller then passes each secret explicitly:
7373
7474
```yaml
7575
deploy:
@@ -84,6 +84,8 @@ deploy:
8484
8585
> [!IMPORTANT]
8686
> For deployment workflows that need Azure credentials, `secrets: inherit` is the simplest approach. However, defining specific secrets provides better documentation and prevents accidentally exposing secrets the reusable workflow doesn't need. We'll use `secrets: inherit` in this exercise for simplicity.
87+
>
88+
> Note: In this workshop, `azd pipeline config` stored the Azure credentials as **repository variables** (accessed via `vars.*`), not secrets. The example above illustrates the pattern for cases where credentials _are_ stored as secrets.
8789

8890
## Create a reusable deployment workflow
8991

@@ -203,7 +205,7 @@ Now let's add the second caller — a manual deploy workflow for rollbacks and h
203205

204206
This workflow is only triggered **manually** via `workflow_dispatch` — it appears as a "Run workflow" button in the Actions tab. It prompts for a **git ref** (a commit SHA, tag, or branch name to deploy), passes that ref to the reusable workflow's `deploy-ref` input, and uses the same deploy logic as the automated pipeline.
205207

206-
3. In the terminal (<kbd>Ctl</kbd>+<kbd>`</kbd> to toggle), commit and push your changes:
208+
3. In the terminal (<kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle), commit and push your changes:
207209

208210
```bash
209211
git add .github/workflows/reusable-deploy.yml .github/workflows/azure-dev.yml .github/workflows/manual-deploy.yml

content/github-actions/9-required-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Let's create a ruleset that requires our tests to pass, and pull requests to be
9494

9595
Let's verify the ruleset is working.
9696

97-
1. Return to your codespace and open the terminal (<kbd>Ctl</kbd>+<kbd>`</kbd> to toggle). Create a new branch and make a small change:
97+
1. Return to your codespace and open the terminal (<kbd>Ctrl</kbd>+<kbd>`</kbd> to toggle). Create a new branch and make a small change:
9898

9999
```bash
100100
git checkout -b test-ruleset
@@ -146,7 +146,7 @@ This pipeline follows the same patterns used by teams across GitHub. As the shel
146146

147147
If you want to keep exploring, here are some suggested next steps:
148148

149-
- Add a code scanning workflow using [GitHub Advanced Security][github-security].
149+
- Add a custom CodeQL workflow using [GitHub Advanced Security][github-security].
150150
- Explore [GitHub Environments][environments-docs] with deployment protection rules for staged deployments (e.g., staging → production with manual approval).
151151
- Explore the [GitHub Actions Marketplace][actions-marketplace] for community-built actions.
152152
- Take the [GitHub Skills: Deploy to Azure][skills-deploy-azure] course for a deeper dive into Azure deployment.

content/github-actions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To complete this workshop, you will need the following:
2626
1. [Introduction & Your First Workflow][introduction] — Create your first workflow and explore the Actions UI
2727
2. [Securing the Development Pipeline][code-scanning] — Enable code scanning, Dependabot, and secret scanning
2828
3. [Running Tests][ci] — Automate unit and e2e testing with parallel jobs
29-
4. [Caching][marketplace] — Speed up workflows by caching dependencies
29+
4. [Caching][caching] — Speed up workflows by caching dependencies
3030
5. [Matrix strategies & parallel testing][matrix] — Test across multiple configurations simultaneously
3131
6. [Deploying to Azure with azd][deployment] — Set up continuous deployment to Azure
3232
7. [Creating custom actions][custom-actions] — Build your own reusable action
@@ -57,7 +57,7 @@ To complete this workshop, you will need the following:
5757
[github-copilot]: https://github.com/features/copilot
5858
[github-signup]: https://github.com/join
5959
[introduction]: ./1-introduction.md
60-
[marketplace]: ./4-caching.md
60+
[caching]: ./4-caching.md
6161
[matrix]: ./5-matrix-strategies.md
6262
[protection]: ./9-required-workflows.md
6363
[repo-root]: /

0 commit comments

Comments
 (0)