Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 1, 2026

Adds skip-if-no-match field to the on: section that skips workflow execution when a GitHub search query returns no matches (or fewer than minimum required). This is the inverse of skip-if-match which skips when matches exist.

Changes

Schema & Types

  • Added skip-if-no-match to workflow schema supporting both string format (implies min: 1) and object format with explicit min threshold
  • Added SkipIfNoMatchConfig struct and SkipIfNoMatch field to WorkflowData
  • Added constants: CheckSkipIfNoMatchStepID, SkipNoMatchCheckOkOutput

Compiler Integration

  • Created check_skip_if_no_match.cjs handler that validates minimum match count via GitHub search API
  • Updated buildPreActivationJob() to generate skip-if-no-match check step when configured
  • Updated activation condition logic to include skip_no_match_check_ok output
  • Added extraction/processing functions in stop_after.go

Documentation

  • Added skip-if-no-match section to triggers.md with usage examples and common patterns

Applied to issue-monster Workflow

  • Added skip-if-no-match: "is:issue is:open" to the issue-monster workflow to prevent unnecessary runs when there are no open issues to process

Usage

# Wait for deployment PRs before running
on:
  schedule:
    - cron: "0 */2 * * *"
  skip-if-no-match: "is:pr is:open label:ready-to-deploy"

# Require minimum threshold
on:
  workflow_dispatch:
  skip-if-no-match:
    query: "is:issue is:open label:needs-review"
    min: 5

# Combine with skip-if-match for complex conditions
on:
  workflow_dispatch:
  skip-if-match: "is:issue is:open label:blocker"
  skip-if-no-match: "is:pr is:open label:ready"

Testing

Added comprehensive test suite covering string format, object format, combined checks, and edge cases. All tests passing.

Original prompt

Add a "skip-if-no-match" field support in the "on" section that works as opposite to the "skip-if-match" field.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 1, 2026
Copilot AI changed the title [WIP] Add skip-if-no-match field support in on section Add skip-if-no-match field support as inverse of skip-if-match Jan 1, 2026
Copilot AI requested a review from pelikhan January 1, 2026 19:03
@pelikhan
Copy link
Contributor

pelikhan commented Jan 1, 2026

@copilot add skip of no match opened issues to issue-monster

@pelikhan
Copy link
Contributor

pelikhan commented Jan 1, 2026

@copilot keep working

The workflow now skips execution if there are no open issues to process, preventing unnecessary runs when the issue queue is empty.

Co-authored-by: pelikhan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 1, 2026

@copilot keep working

Added skip-if-no-match to issue-monster workflow in commit 637f0e8. The workflow now includes:

skip-if-no-match: "is:issue is:open"

This prevents the workflow from running when there are no open issues in the repository, saving CI resources. The workflow will now skip execution if:

  1. There are 9+ draft PRs from Copilot (skip-if-match condition)
  2. There are NO open issues to process (skip-if-no-match condition)

@pelikhan pelikhan marked this pull request as ready for review January 1, 2026 20:09
@pelikhan pelikhan merged commit a43b976 into main Jan 1, 2026
131 of 132 checks passed
@pelikhan pelikhan deleted the copilot/add-skip-if-no-match-field branch January 1, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants