From c5103bcda82abff675924e88bddcc1a1ca8178b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 01:07:34 +0000 Subject: [PATCH] Add node 13: Schedule It to Run Every Day Fills the missing step 13 gap in the main workshop path. The step teaches learners to change their workflow's on: block to use a scheduled trigger with fuzzy syntax, compile, commit, and verify the schedule was registered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- workshop/12-test-and-iterate.md | 2 +- workshop/13-schedule-your-workflow.md | 102 ++++++++++++++++++ workshop/14-next-steps.md | 2 +- workshop/README.md | 5 +- .../side-quest-13-01-schedule-expressions.md | 6 +- 5 files changed, 110 insertions(+), 7 deletions(-) create mode 100644 workshop/13-schedule-your-workflow.md diff --git a/workshop/12-test-and-iterate.md b/workshop/12-test-and-iterate.md index 0fe6c986..9a34ea58 100644 --- a/workshop/12-test-and-iterate.md +++ b/workshop/12-test-and-iterate.md @@ -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 -**Next:** [What's Next? Keep Exploring](14-next-steps.md) +**Next:** [Schedule It to Run Every Day](13-schedule-your-workflow.md) diff --git a/workshop/13-schedule-your-workflow.md b/workshop/13-schedule-your-workflow.md new file mode 100644 index 00000000..2cd8dac8 --- /dev/null +++ b/workshop/13-schedule-your-workflow.md @@ -0,0 +1,102 @@ + + +# 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. + +
+πŸ–₯️ GitHub UI alternative + +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. + +
+ +### 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 + + +**Next:** [What's Next? Keep Exploring](14-next-steps.md) + diff --git a/workshop/14-next-steps.md b/workshop/14-next-steps.md index 02f4968f..c12001de 100644 --- a/workshop/14-next-steps.md +++ b/workshop/14-next-steps.md @@ -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 diff --git a/workshop/README.md b/workshop/README.md index fbacc3bc..8219f12c 100644 --- a/workshop/README.md +++ b/workshop/README.md @@ -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 | βœ… | @@ -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). diff --git a/workshop/side-quest-13-01-schedule-expressions.md b/workshop/side-quest-13-01-schedule-expressions.md index 63f953b0..49dfc1fc 100644 --- a/workshop/side-quest-13-01-schedule-expressions.md +++ b/workshop/side-quest-13-01-schedule-expressions.md @@ -2,11 +2,11 @@ # 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. @@ -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).