Skip to content

Commit e32c6a4

Browse files
author
UncleBats
committed
fix exercise 3
1 parent 7bddb72 commit e32c6a4

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

docs/workshop/participant-handout.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ jobs:
241241

242242
- name: Validate JavaScript Files
243243
run: |
244-
node --check Solutions/JavaScript/*.js
244+
for f in Solutions/JavaScript/*.js; do node --check "$f"; done
245245
echo "JavaScript syntax validation passed"
246246
247247
build-python:
@@ -998,7 +998,7 @@ permissions:
998998

999999
network: defaults
10001000

1001-
engine: claude
1001+
engine: copilot
10021002

10031003
safe-outputs:
10041004
create-issue:
@@ -1020,7 +1020,6 @@ safe-outputs:
10201020
tools:
10211021
cache-memory: true
10221022
web-fetch:
1023-
web-search:
10241023
github:
10251024
toolsets: [default, actions] # default: context, repos, issues, pull_requests; actions: workflow logs and artifacts
10261025

@@ -1538,8 +1537,16 @@ git checkout -b test/trigger-ci-doctor
15381537

15391538
Create a syntax error in a JavaScript file:
15401539

1540+
**Bash (Mac/Linux):**
1541+
15411542
```bash
1542-
echo "this is not valid javascript %%%" >> Solutions/JavaScript/The-Clockwork-Town-of-Tempora/The-Clockwork-Town-of-Tempora.js
1543+
echo "this is not valid javascript %%%" >> Solutions/JavaScript/The-Clockwork-Town-of-Tempora.js
1544+
```
1545+
1546+
**PowerShell (Windows):**
1547+
1548+
```powershell
1549+
Add-Content -Path .\Solutions\JavaScript\The-Clockwork-Town-of-Tempora.js -Value "this is not valid javascript %%%"
15431550
```
15441551

15451552
Commit, push, and create a PR:
@@ -1563,9 +1570,40 @@ gh pr create --title "Test: Trigger CI Doctor" --body "Intentionally breaking a
15631570
- Specific recommended fixes with file paths
15641571
- Prevention tips
15651572

1566-
**Step 8: Clean up**
1573+
> **💡 Tip: Automatic triggering on CI failure**
1574+
>
1575+
> The workflow we created uses `label_command` — you manually add the `ci-doctor` label to trigger it. If you want the CI Doctor to run **automatically** whenever CI fails, replace the `on:` trigger in `ci-doctor.md` with:
1576+
>
1577+
> ```yaml
1578+
> on:
1579+
> label_command:
1580+
> name: ci-doctor
1581+
> events: [pull_request]
1582+
> workflow_run:
1583+
> workflows: ["CI"]
1584+
> types: [completed]
1585+
> conclusions: [failure]
1586+
> ```
1587+
>
1588+
> This keeps the label-based on-demand trigger **and** adds automatic activation whenever the CI workflow completes with a failure. After changing the trigger, recompile with `gh aw compile ci-doctor`, commit, and push.
1589+
1590+
**Step 8: Clean up or fix**
1591+
1592+
Once you've reviewed the CI Doctor's diagnosis, you have two options:
1593+
1594+
**Option A: Ask Copilot to fix it**
1595+
1596+
Instead of fixing the issue manually, you can comment on the PR:
1597+
1598+
```
1599+
@copilot fix the issue
1600+
```
1601+
1602+
Copilot will pick up the CI Doctor's diagnostic comment and use it as context to create a fix commit directly on the PR branch. This isn't the CI Doctor workflow — it's GitHub Copilot's built-in PR capability, but it leverages the diagnosis the CI Doctor already posted.
1603+
1604+
**Option B: Clean up the test branch**
15671605

1568-
Once you've seen the CI Doctor in action:
1606+
If you just want to discard the intentional breakage:
15691607

15701608
```bash
15711609
git checkout main

0 commit comments

Comments
 (0)