Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion workshop/12-test-and-iterate.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ If you want a stricter review loop, score each run for accuracy, completeness, a
- [ ] I compared the new run with the previous run and decided what to change next

<!-- journey: all -->
**Next:** [What's Next? Keep Exploring](14-next-steps.md)
**Next:** [Schedule It to Run Every Day](13-schedule-your-workflow.md)
<!-- /journey -->
102 changes: 102 additions & 0 deletions workshop/13-schedule-your-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!-- page-journey: all -->
<!-- page-adventure: core -->
# Schedule It to Run Every Day

> _A workflow that runs itself is more useful than one you have to remember to trigger._

## 🎯 What You'll Do

Right now your workflow runs when you click **Run workflow** in the Actions tab. You'll change that so it fires automatically on a schedule — and add a manual trigger so you can still run it on demand. By the end, your workflow will wake up and report every weekday without any action from you.

## 📋 Before You Start

- You have iterated on your workflow in [Test and Improve Your Workflow](12-test-and-iterate.md).
- You can edit `.github/workflows/daily-report-status.md` in a Codespace, terminal, or the GitHub web editor.

## Steps

### Understand how gh-aw scheduling works

At the top of your workflow file you have YAML frontmatter between `---` fences. The `on:` block controls when GitHub Actions runs the workflow.

`gh-aw` lets you write a human-readable schedule instead of a raw cron expression:

```yaml
on:
schedule: daily on weekdays
workflow_dispatch: {}
```

When you run `gh aw compile`, the compiler translates `daily on weekdays` into a `cron:` value and writes it into your `.lock.yml` file. You never have to write cron by hand.

> [!TIP]
> Always keep `workflow_dispatch: {}` alongside `schedule:`. It lets you trigger the workflow manually from the **Actions** tab for quick tests even when no scheduled run is due.

Common schedule expressions:

| Expression | Runs… |
|------------|-------|
| `daily` | Once per day |
| `daily on weekdays` | Monday–Friday, once per day |
| `weekly` | Once per week |
| `every 6 hours` | Four times per day |

Need help picking one? See the [Schedule Expressions reference](side-quest-13-01-schedule-expressions.md).

### Update your workflow frontmatter

Open `.github/workflows/daily-report-status.md`. Find the `on:` block near the top and update it:

```yaml
on:
schedule: daily on weekdays
workflow_dispatch: {}
```

If your frontmatter already has `schedule: daily`, change it to `daily on weekdays` to keep the workflow quiet on weekends.

<details>
<summary>🖥️ GitHub UI alternative</summary>

1. In your repository on GitHub, navigate to `.github/workflows/daily-report-status.md`.
2. Click the **pencil icon (✏️)** to open the web editor.
3. Update the `on:` block as shown above.
4. Click **Commit changes** and commit directly to your default branch.

After committing via the UI, the `.lock.yml` file needs to be regenerated. Either run `gh aw compile` locally and push the updated lock file, or trigger a manual run — the Actions log will show a compilation step that regenerates it automatically if your repository has a compile step configured.

</details>

### Compile and push the updated workflow

After saving the file, regenerate the lock file:

```bash
gh aw compile
git add .github/workflows/daily-report-status.md .github/workflows/daily-report-status.lock.yml
git commit -m "schedule workflow to run daily on weekdays"
git push
```

### Verify the schedule was registered

1. Go to the **Actions** tab in your repository.
2. Select the **daily-report-status** workflow in the left sidebar.
3. Click **Run workflow** → **Run workflow** to trigger a manual run and confirm everything still works.
4. Return the next weekday morning — the workflow will have run overnight automatically.

> [!NOTE]
> GitHub Actions schedules use **UTC**. A `daily on weekdays` schedule typically fires between 9 AM and midnight UTC, at a scattered minute chosen by the compiler to avoid load spikes. Check your compiled `.lock.yml` for the exact `cron:` value.

## ✅ Checkpoint

- [ ] Your workflow frontmatter has `schedule: daily on weekdays` and `workflow_dispatch: {}`
- [ ] You ran `gh aw compile` and the `.lock.yml` was regenerated without errors
- [ ] Both `daily-report-status.md` and `daily-report-status.lock.yml` are committed and pushed
- [ ] A manual run from the **Actions** tab completed successfully
- [ ] You can find the compiled `cron:` value in the `.lock.yml` file
- [ ] You know that the schedule runs in UTC and can translate it to your local time zone

<!-- journey: all -->
**Next:** [What's Next? Keep Exploring](14-next-steps.md)
<!-- /journey -->
2 changes: 1 addition & 1 deletion workshop/14-next-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Take stock of everything you've learned, then choose a direction for what to bui

## 📋 Before You Start

- You have a scheduled daily-status workflow running in GitHub Actions from [Schedule It to Run Every Day](12-test-and-iterate.md).
- You have a scheduled daily-status workflow running in GitHub Actions from [Schedule It to Run Every Day](13-schedule-your-workflow.md).

## Steps

Expand Down
5 changes: 3 additions & 2 deletions workshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A hands-on workshop that takes you from zero to a fully automated, AI-powered wo
| 8b | [08b-interpret-your-run.md](08b-interpret-your-run.md) | Interpret Your First Run | ✅ |
| 9 | [09-agentic-editing.md](09-agentic-editing.md) | Refine Your Workflow with Agentic Editing | ✅ |
| 12 | [12-test-and-iterate.md](12-test-and-iterate.md) | Test and Improve Your Workflow | ✅ |
| 13 | [13-schedule-your-workflow.md](13-schedule-your-workflow.md) | Schedule It to Run Every Day | ✅ |
| 14 | [14-next-steps.md](14-next-steps.md) | What's Next? Keep Exploring | ✅ |
| 15 | [15-conditional-logic.md](15-conditional-logic.md) | Make Your Workflow Smarter with Conditional Logic | ✅ |
| 16 | [16-connect-data-source.md](16-connect-data-source.md) | Connect a Live Data Source to Your Workflow | ✅ |
Expand All @@ -45,14 +46,14 @@ A hands-on workshop that takes you from zero to a fully automated, AI-powered wo
- [Side Quest: Terminal Basics](side-quest-01-01-terminal-basics.md) — optional primer that branches from [Step 1](01-prerequisites.md).
- [Side Quest: Environment Reference](side-quest-01-02-environment-reference.md) — glossary of workshop environments and tool terms with official docs links; branches from [Step 1](01-prerequisites.md).
- [Side Quest: Install `gh-aw` Troubleshooting](side-quest-06-01-install-troubleshooting.md) — optional install troubleshooting reference that branches from [Step 6](06-install-gh-aw.md).
- [Side Quest: Using `gh aw compile` to Catch Errors Early](side-quest-07-01-compile-workflow.md) — quick reference for `gh aw compile`, `--validate`, `--watch`, and common compile errors; branches from [Step 7](07-your-first-workflow.md), [Step 11a](07-your-first-workflow.md), or [Step 13](12-test-and-iterate.md).
- [Side Quest: Using `gh aw compile` to Catch Errors Early](side-quest-07-01-compile-workflow.md) — quick reference for `gh aw compile`, `--validate`, `--watch`, and common compile errors; branches from [Step 7](07-your-first-workflow.md), [Step 11a](07-your-first-workflow.md), or [Step 13](13-schedule-your-workflow.md).
- [Side Quest: Fix Codespaces `actions:write` Errors When Running `gh aw run`](side-quest-08-01-codespaces-actions-write.md) — troubleshooting guide for Codespaces workflow-trigger permission errors with a UI-first path and advanced recovery path; branches from [Step 8](08-run-your-workflow.md).
- [Side Quest: Diagnosing Common Agent Output Patterns](side-quest-09-01-debug-output.md) — expanded troubleshooting guide for the five most common log patterns; branches from [Step 9](08b-interpret-your-run.md).
- [Side Quest: Writing a Clear Agent Brief](side-quest-10-01-agent-brief.md) — five-step framework for designing any agentic workflow brief; branches from [Step 10](09-agentic-editing.md).
- [Side Quest: Jailbreaking the Agent Brief](side-quest-10-02-jailbreak-brief.md) — explains how adversarial instructions embedded in repository content attempt to override the agent's task brief, and how the compiled brief, minimal `permissions:`, `safe-outputs`, and `network.allowed-domains` contain any partial success; branches from [Step 10](09-agentic-editing.md).
- [Side Quest: Frontmatter Deep Dive — Part A](side-quest-11-01-frontmatter-deep-dive.md) — walkthrough of the opening, trigger, and permissions sections of `gh-aw` frontmatter, with predict-and-try activities; branches from [Step 11a](07-your-first-workflow.md).
- [Side Quest: Frontmatter Deep Dive — Part B](side-quest-11-08-frontmatter-tools-outputs.md) — walkthrough of the tools, safe-outputs, closing fence, and agent body sections, with predict-and-try activities; continues from Part A.
- [Side Quest: Fuzzy Schedule Expressions](side-quest-13-01-schedule-expressions.md) — quick reference for choosing between `daily`, `hourly`, `weekly`, and other fuzzy schedule expressions; branches from [Step 13](12-test-and-iterate.md).
- [Side Quest: Fuzzy Schedule Expressions](side-quest-13-01-schedule-expressions.md) — quick reference for choosing between `daily`, `hourly`, `weekly`, and other fuzzy schedule expressions; branches from [Step 13](13-schedule-your-workflow.md).
- [Side Quest: Evaluating and Iterating on Agent Output](side-quest-12-01-iterate-agent-output.md) — structured rubric for judging output quality, a five-row problem-to-fix reference table, and a one-change-at-a-time iteration loop; branches from [Step 12](12-test-and-iterate.md).
- [Side Quest: GitHub Actions Expressions and Contexts](side-quest-15-01-expressions-and-contexts.md) — deep dive into `${{ }}` syntax, available context objects, output references, and `if:` conditions; branches from [Step 15](15-conditional-logic.md).
- [Side Quest: YAML Frontmatter Pitfalls](side-quest-11-02-yaml-frontmatter.md) — reference guide for the five most common YAML mistakes; branches from [Step 11a](07-your-first-workflow.md).
Expand Down
6 changes: 3 additions & 3 deletions workshop/side-quest-13-01-schedule-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!-- page-adventure: side-quest -->
# Side Quest: Fuzzy Schedule Expressions

> _Optional: use this quick reference if you want help choosing a schedule expression for [Schedule It to Run Every Day](12-test-and-iterate.md), then return to the main adventure._
> _Optional: use this quick reference if you want help choosing a schedule expression for [Schedule It to Run Every Day](13-schedule-your-workflow.md), then return to the main adventure._

## 📋 Before You Start

- You have completed [Schedule It to Run Every Day](12-test-and-iterate.md) or are working through it now.
- You have completed [Schedule It to Run Every Day](13-schedule-your-workflow.md) or are working through it now.
- You understand that [GitHub Actions](https://github.github.com/gh-aw/reference/triggers/) schedules use **cron expressions** (e.g., `0 9 * * 1` runs at 09:00 UTC every Monday).
- You know how to run `gh aw compile` to regenerate a workflow's lock file.

Expand Down Expand Up @@ -86,7 +86,7 @@ If none of the fuzzy options match your exact timing need, choose the closest fu

---

Return to the main adventure: [Schedule It to Run Every Day](12-test-and-iterate.md).
Return to the main adventure: [Schedule It to Run Every Day](13-schedule-your-workflow.md).

<!-- /journey -->