Skip to content

Commit bab9516

Browse files
authored
Reduce cognitive load in Step 16 data-source workshop content (#1377)
1 parent 49f8337 commit bab9516

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

workshop/16-connect-data-source.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ You'll extend your daily-status workflow to fetch open issues from your reposito
1616

1717
### Understand the data-flow pattern
1818

19-
[gh-aw workflows](https://github.github.com/gh-aw/introduction/overview/) run inside GitHub Actions, so you can run any shell command — including `gh`. The pattern has three parts:
19+
[gh-aw workflows](https://github.github.com/gh-aw/introduction/overview/) run inside GitHub Actions, so your workflow can fetch live repository data before the AI writes anything. In this step, you will use shell steps to collect data and a later prompt section to turn that data into a summary.
2020

21-
1. A shell step fetches data and writes it to `$GITHUB_OUTPUT`.
22-
2. A step ID (e.g., `id: recent`) names the step.
23-
3. The prompt references the output with `${{ steps.<id>.outputs.<key> }}`.
21+
Think of it as a handoff. First, the workflow gathers facts in a predictable way. Then, the prompt reads those saved results and asks the AI to explain what matters.
2422

2523
> [!TIP]
26-
> If you're unfamiliar with `$GITHUB_OUTPUT`, read [Side Quest: Passing Data Between Steps with $GITHUB_OUTPUT](side-quest-16-01-github-output.md). If you're deciding which parts should be fixed scripts versus AI reasoning, read [Side Quest: Deterministic vs Agentic Data Ops](side-quest-16-04-deterministic-vs-agentic-data-ops.md).
24+
> If step outputs, here-document syntax, or the scripted versus agentic split are new to you, skim [Side Quest: Passing Data Between Steps with $GITHUB_OUTPUT](side-quest-16-01-github-output.md) and [Side Quest: Deterministic vs Agentic Data Ops](side-quest-16-04-deterministic-vs-agentic-data-ops.md).
2725
2826
### Fetch commit history
2927

@@ -43,7 +41,7 @@ First, fetch the recent commit log:
4341
echo "EOF" >> $GITHUB_OUTPUT
4442
```
4543
46-
🤔 **Predict:** What will `${{ steps.recent.outputs.commit_log }}` contain if no commits were made in the last 24 hours? Form your prediction now and verify it after you trigger a run.
44+
🤔 Pause and predict: What will the `commit_log` output contain if no commits were made in the last 24 hours? Form your prediction now and verify it after you trigger a run.
4745

4846
### Fetch open issues
4947

@@ -67,13 +65,13 @@ Next, add a step to fetch open issues:
6765
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # provided automatically — no setup needed
6866
```
6967

70-
✏️ **Try it:** Run `gh issue list --state open --json number --jq 'length'` in your terminal and note the count. After you trigger a workflow run, check whether `open_issues_count` matches.
68+
✏️ Try it: Run `gh issue list --state open --json number --jq 'length'` in your terminal and note the count. After you trigger a workflow run, check whether the workflow reports the same total.
7169

72-
🤔 **Predict:** What will the AI receive if `open_issues` is empty (no open issues in the repo)? Will the prompt still produce a useful output?
70+
🤔 Pause and predict: What will the AI receive if the issue list is empty? Will the prompt still produce a useful output?
7371

7472
### Inject data into your AI prompt
7573

76-
The AI prompt is the **Markdown body** after the closing `---` of the frontmatter — update it to reference the step outputs:
74+
The AI prompt lives in the Markdown body after the frontmatter. Update that section so it uses the step outputs:
7775

7876
```markdown
7977
---
@@ -92,11 +90,11 @@ Write a concise, friendly update — two short paragraphs.
9290
Highlight anything that looks urgent in the issue list.
9391
```
9492

95-
`${{ steps.<id>.outputs.<key> }}` expressions are resolved at runtime before the AI sees the prompt.
93+
GitHub resolves the step-output expressions before the AI sees the prompt, so the model receives plain text instead of workflow syntax.
9694

97-
🤔 **Predict:** If `commit_log` is empty, does the prompt still make sense to the AI? What one-line change would make the instruction more robust?
95+
🤔 Pause and predict: If the `commit_log` output is empty, does the prompt still make sense to the AI? What one-line change would make the instruction more robust?
9896

99-
✏️ **Try it:** Change `"two short paragraphs"` to `"one bullet list per topic"` and re-run. Notice how the output format shifts.
97+
✏️ Try it: Change `"two short paragraphs"` to `"one bullet list per topic"` and re-run. Notice how the output format shifts.
10098

10199
### Compile and test
102100

@@ -132,14 +130,13 @@ Once you're comfortable with this pattern, the same technique works for:
132130

133131
## ✅ Checkpoint
134132

135-
- [ ] Your workflow has a `fetch recent commits` step with `id: recent`
136-
- [ ] Your workflow has a `fetch open issues` step with `id: issues`
137-
- [ ] Your AI prompt references `steps.recent.outputs.commit_log` and `steps.issues.outputs.open_issues`
133+
- [ ] Your workflow has a recent-commits step with `id: recent`
134+
- [ ] Your workflow has an open-issues step with `id: issues`
135+
- [ ] Your AI prompt uses both saved outputs
138136
- [ ] `gh aw compile` reports no errors
139137
- [ ] A manual run completes and the summary mentions both commits and open issues
140-
- [ ] You can explain the `<<EOF` multi-line output syntax in your own words
141-
- [ ] You can explain why `export` doesn't pass data between steps and `$GITHUB_OUTPUT` does
142-
- [ ] You can describe what happens if `commit_log` is empty and how your prompt handles it
138+
- [ ] You can explain how the workflow passes fetched data into the prompt
139+
- [ ] You can describe what happens if the recent commit output is empty and how your prompt handles it
143140

144141
**Next:** [Give Your Agent More Tools with MCP](17-add-mcp-tools.md)
145142

0 commit comments

Comments
 (0)