Skip to content
Merged
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
6 changes: 6 additions & 0 deletions workshop/15-conditional-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ The approach breaks into three parts:
2. Reference that output using the `steps` context expression `${{ steps.recent.outputs.commit_count }}`.
3. Add a top-level `if:` key in the workflow [frontmatter](https://github.github.com/gh-aw/reference/frontmatter/) that skips the agent job when the count evaluates to zero.

<picture>
<source media="(prefers-color-scheme: dark)" srcset="images/15-conditional-flow-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="images/15-conditional-flow-light.svg">
<img alt="Conditional logic flow: shell step writes commit count to GITHUB_OUTPUT, the if condition evaluates it, then either skips or runs the agent job" src="images/15-conditional-flow-light.svg">
</picture>

### Add a commit-count step

Open your daily-status workflow file (e.g., `.github/workflows/daily-status.md`) and add the following block inside the YAML frontmatter under `steps:`:
Expand Down
84 changes: 84 additions & 0 deletions workshop/images/15-conditional-flow-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions workshop/images/15-conditional-flow-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading