-
Notifications
You must be signed in to change notification settings - Fork 28
Configure Q workflow to skip PR creation when no changes exist #4128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…n no changes - Add `if-no-changes: "ignore"` to q.md's create-pull-request safe output - Update Phase 6 prompt to emphasize checking for changes before PR creation - System will now silently skip PR creation when there are no file changes - Addresses user requirement: "Only create pull request if there are changes" Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR configures the Q workflow to skip pull request creation when no file changes are made, preventing empty PRs from being generated. The implementation adds the if-no-changes: "ignore" configuration parameter and updates the agent prompt to clarify when PR creation should occur.
Key Changes:
- Added
if-no-changes: "ignore"to thecreate-pull-requestsafe output configuration - Updated Phase 6 instructions to emphasize checking for changes before PR creation
- Clarified the distinction between using
add-comment(for findings without changes) vscreate-pull-request(for actual modifications)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/q.md |
Added if-no-changes: "ignore" configuration and updated Phase 6 instructions to guide the agent on when to create PRs vs comments |
.github/workflows/q.lock.yml |
Compiled workflow reflecting the frontmatter configuration change and updated prompt instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Before calling create-pull-request, verify you have modified workflow files | ||
| - If investigation shows no issues or improvements needed, use add-comment to report findings | ||
| - Only proceed with PR creation when you have actual changes to propose | ||
| 2. **Use Safe-Outputs for PR Creation**: | ||
| - Use the `create-pull-request` tool from the safe-outputs MCP server | ||
| - This is automatically configured in the workflow frontmatter | ||
| - The PR will be created with the prefix "[q]" and labeled with "automation, workflow-optimization" | ||
| - The system will automatically skip PR creation if there are no file changes |
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] There's potential confusion in the instruction flow. The prompt tells the agent to "Check for Changes First" and only "proceed with PR creation when you have actual changes to propose" (lines 248-251), but then also states "The system will automatically skip PR creation if there are no file changes" (line 257).
This creates ambiguity about whether the agent should:
- Not call
create-pull-requestat all when there are no changes, OR - Always call
create-pull-requestand rely on the system to skip it automatically
Consider clarifying the instruction, such as: "You may call create-pull-request even without changes - the system will automatically skip PR creation if the patch is empty. However, you should only call it after making intentional modifications to workflow files."
| - Before calling create-pull-request, verify you have modified workflow files | |
| - If investigation shows no issues or improvements needed, use add-comment to report findings | |
| - Only proceed with PR creation when you have actual changes to propose | |
| 2. **Use Safe-Outputs for PR Creation**: | |
| - Use the `create-pull-request` tool from the safe-outputs MCP server | |
| - This is automatically configured in the workflow frontmatter | |
| - The PR will be created with the prefix "[q]" and labeled with "automation, workflow-optimization" | |
| - The system will automatically skip PR creation if there are no file changes | |
| - Only call `create-pull-request` after you have intentionally modified workflow files. | |
| - If your investigation shows no issues or improvements are needed, use `add-comment` to report your findings instead of creating a PR. | |
| - You may call `create-pull-request` even if there are no changes; the system will automatically skip PR creation if the patch is empty. However, only do this after making intentional modifications to workflow files. | |
| 2. **Use Safe-Outputs for PR Creation**: | |
| - Use the `create-pull-request` tool from the safe-outputs MCP server. | |
| - This is automatically configured in the workflow frontmatter. | |
| - The PR will be created with the prefix "[q]" and labeled with "automation, workflow-optimization". | |
| - If there are no file changes, the system will automatically skip PR creation. |
The Q workflow creates PRs even when no file changes are made, generating empty PRs. User requirement: "Only create pull request if there are changes."
Changes
Configuration (
.github/workflows/q.md)if-no-changes: "ignore"tocreate-pull-requestsafe outputPrompt (
.github/workflows/q.md)Behavior
The
if-no-changesparameter already exists in the safe-outputs infrastructure with three modes:warn(default),error,ignore. Setting toignoreprovides the cleanest UX for automated workflows.Original prompt
This section details on the original issue you should resolve
<issue_title>[q] Fix Q workflow to always create pull requests</issue_title>
<issue_description># Q Workflow Optimization Report
Issue Identified (from live data)
Q Workflow (.github/workflows/q.md)
Triggering Request: "/q the agent forgot to call create pull request. update prompt to insist on calling it."
Log Analysis: Examined run githubnext/gh-aw#19345423304
create_pull_requestjob was skippedPattern Identified: The Q workflow is inconsistently creating pull requests. In some runs, the agent investigates workflows and provides findings via comments but forgets to create a PR with the actual workflow improvements.
Changes Made
.github/workflows/q.md
Problem: The workflow prompt mentioned PR creation but wasn't forceful enough about this being a mandatory requirement.
Solution: Added multiple explicit reminders and made PR creation a CRITICAL REQUIREMENT:
Added CRITICAL REQUIREMENT in Mission section (line 51-52):
Made Phase 6 explicitly MANDATORY (line 243):
Added pre-success-criteria checklist (line 378-388):
Strengthened final reminder (line 400-402):
Expected Improvements
Validation
Workflow compiled successfully:
Evidence
/tmp/gh-aw/aw-mcp/logs/run-19345423304/run_summary.jsonImplementation Details
The changes are entirely prompt-based improvements:
Note: This PR demonstrates Q fixing Q - the workflow optimizer improving itself based on user feedback!
Show patch preview (85 of 85 lines)