Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(#295): add task preconditions for conditional execution#360

Open
johnjansen wants to merge 1 commit into
main from
feat/295-task-preconditions
Open

feat(#295): add task preconditions for conditional execution #360
johnjansen wants to merge 1 commit into
main from
feat/295-task-preconditions

Conversation

@johnjansen

@johnjansen johnjansen commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added support for task preconditions that allow users to specify conditions under which tasks should execute
  • Implemented precondition conditions including day_of_week, time_range, env_set, and expr
  • Both pre_check and precondition conditions must pass for a task to run
  • Clear skip reasons are logged when preconditions fail

Test plan

  • Verify build passes
  • Verify tests pass
  • Test precondition evaluation with sample tasks
  • Verify backward compatibility with existing tasks

🤖 Generated with Claude Code

Added support for task preconditions that allow users to specify conditions
under which tasks should execute. Precondition conditions include:
- day_of_week: restrict execution to specific days (e.g., "1-5" for weekdays)
- time_range: restrict execution to specific time ranges (e.g., "09:00-17:00")
- env_set: require specific environment variables to be set
- expr: complex expressions using Go template syntax
Both pre_check and precondition conditions must pass for a task to run.
If any precondition fails, the task is skipped with a clear skip reason.
Example usage:
---
schedule: "0 9 * * *"
precondition:
 day_of_week: "1-5" # only weekdays
 time_range: "09:00-17:00" # only business hours
 env_set: "CI" # only when CI env var is set
---
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /