feat: add allow-empty option for path-filtered workflow support - #131
Merged
Conversation
When Sloth runs alongside path-filtered workflows, some PRs may not trigger any other checks. Previously, Sloth would poll until timeout and then fail. The new allow-empty input (default false) lets Sloth succeed when no other checks are found. To prevent a race condition where Sloth passes before other workflows have been scheduled, Sloth waits for an empty-settle-time period (default 30s) before accepting an empty result. If any check appears during the settle period, Sloth resumes normal wait behaviour. No change to default behaviour — allow-empty defaults to false. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract the wait loop from index.ts into wait-for-check-runs.ts with injectable dependencies, enabling comprehensive test coverage. Add empty-settle-time input (default 30s) to prevent a race condition where Sloth accepts empty before other workflows have been scheduled. Sloth now polls for the settle period before accepting an empty result. Test coverage for the wait loop includes: - Standard success, failure, pending-then-success, and timeout paths - allow-empty disabled: polls until timeout with no checks - allow-empty enabled: waits for settle time before accepting empty - Checks appearing during settle period resume normal behaviour - Checks failing during settle period correctly fail - Settle time of 0 accepts empty immediately - Settle time exceeding timeout correctly times out Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nt rule Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Jose Guardiola (JoseGuardiola)
approved these changes
Apr 7, 2026
Merged
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 7, 2026
I have created a release PR for this version --- ## [1.1.0](1.0.0...1.1.0) (2026-04-07) ### Features * Add allow-empty option for path-filtered workflow support ([#131](#131)) ([caf95c6](caf95c6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: lendabot[bot] <126705550+lendabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
allow-emptyinput (defaultfalse) that lets Sloth succeed when no other check runs are foundempty-settle-timeinput (default30s) — a grace period before accepting an empty result, preventing a race where Sloth passes before other workflows have been scheduledContext
When Sloth runs in a shared workflow (triggered on all PRs) alongside path-filtered workflows, PRs that don't match the path filters (e.g. docs-only changes) will never trigger other checks. Sloth currently polls for 600s then fails with a timeout, blocking the PR.
With
allow-empty: "true", Sloth waits for the settle period, then succeeds if no checks have appeared. If any check appears during the settle period, Sloth resumes normal behaviour.Test plan
🤖 Generated with Claude Code