Skip to content

Configure PR triage reports with 1-day expiration and auto-close older issues#13903

Merged
pelikhan merged 2 commits intomainfrom
copilot/set-pr-triage-expiration
Feb 5, 2026
Merged

Configure PR triage reports with 1-day expiration and auto-close older issues#13903
pelikhan merged 2 commits intomainfrom
copilot/set-pr-triage-expiration

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Configure PR triage reports to expire after 1 day and automatically close previous reports when new ones are created, addressing issue #13861 with @pelikhan's correction from 1 second to 1 day.

Changes

.github/workflows/pr-triage-agent.md

  • Converted from create-discussion to create-issue (required for close-older-issues support)
  • Added expires: 1d for 24-hour auto-closure via maintenance workflow
  • Added close-older-issues: true to close up to 10 previous triage reports on new issue creation
  • Updated success message: "Check the issue" instead of "Check the discussion"
  • Updated Phase 8 instructions to reference GitHub Issue instead of Discussion

Before:

create-discussion:
  max: 1
  category: "general"
  title-prefix: "[PR Triage Report] "

After:

create-issue:
  max: 1
  title-prefix: "[PR Triage Report] "
  expires: 1d
  close-older-issues: true

Impact

  • Triage reports auto-close after 24 hours (maintenance runs every 2 hours for ≤1 day expirations)
  • Only one active triage report exists at any time
  • No manual cleanup required for old reports
Original prompt

This section details on the original issue you should resolve

<issue_title>[q] Set PR triage report expiration to 1s and auto-close older issues</issue_title>
<issue_description>## Q Workflow Optimization Report

Context

This PR addresses the request from issue #13861 to configure PR triage reports to expire after 1 second and automatically close older triage report issues.

Issues Found (from issue context)

PR Triage Agent Workflow

  • Issue [PR Triage Report] 2026-02-05 - 1 PR Triaged #13861: Triage reports were being created without expiration settings
  • Request: Set expiration to 1 second and close older issues
  • Current Behavior: Workflow creates discussions/issues that remain open indefinitely

Changes Made

.github/workflows/pr-triage-agent.md

Changed from create-discussion to create-issue with the following new configurations:

  1. Added expires: 1s: Auto-closes triage report issues after 1 second

    • This extremely short expiration ensures triage reports are closed almost immediately after creation
    • Leverages the agentics-maintenance.yml workflow to auto-close expired issues
  2. Added close-older-issues: true: Automatically closes previous open triage reports

    • When a new triage report is created, all older triage reports from the same workflow are closed
    • Ensures only the latest triage report remains open
    • Prevents accumulation of old triage report issues
  3. Converted from discussion to issue: Changed create-discussion to create-issue

    • Provides access to close-older-issues feature (not available for discussions)
    • Maintains the same functionality with better lifecycle management
    • Removed category: "general" field (discussion-specific)
  4. Updated messaging: Changed success message from "Check the discussion" to "Check the issue"

Expected Improvements

  • Immediate Cleanup: Triage reports will be closed within ~2 hours (1s expiration triggers 2-hour maintenance frequency)
  • No Backlog: Previous triage reports automatically closed when new reports are created
  • Consistent State: Only one active triage report will exist at any time
  • Cleaner Issue List: No accumulation of old triage reports cluttering the repository

Validation

Changes are minimal and targeted:

  • Only modified .github/workflows/pr-triage-agent.md (source file)
  • No changes to .lock.yml files (will be compiled automatically after merge)
  • Configuration follows documented safe-outputs patterns from docs/src/content/docs/reference/safe-outputs.md

Technical Details

Auto-Expiration Mechanism:

  • The expires: 1s field generates/updates agentics-maintenance.yml workflow
  • Maintenance runs every 2 hours (minimum frequency for sub-1-day expirations)
  • Issues are marked with expiration metadata in the body
  • Closed with "OUTDATED" reason when expiration time is reached

Close-Older-Issues Mechanism:

  • When creating a new issue, searches for previous issues with same workflow ID marker
  • Workflow ID marker: ``
  • Closes all matching older issues before creating the new one
  • Ensures atomic transition from old to new report

References

Success Criteria

✅ Configured 1-second expiration for PR triage reports
✅ Enabled automatic closure of older triage reports
✅ Converted from discussion to issue for better lifecycle management
✅ Updated workflow messaging to reflect issue creation
✅ Minimal, surgical changes following Q principles
✅ Follows documented safe-outputs configuration patterns

Fixes #13861

AI generated by Q

  • expires on Feb 7, 2026, 7:11 AM UTC

[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/github/gh-aw/actions/runs/21702190712
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 21702190712 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch (45 lines)
From 3a6cf12e618e61aca61bdad93642e04bbb439fb7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 5 Feb 2026 07:...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes github/gh-aw#13865

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

- Changed from create-discussion to create-issue
- Set expires: 1d (1 day expiration as requested by @pelikhan)
- Added close-older-issues: true to auto-close previous triage reports
- Updated success message from "discussion" to "issue"
- Removed discussion-specific category field
- Updated Phase 8 description to reference GitHub Issue instead of Discussion

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Set PR triage report expiration to 1 second Configure PR triage reports with 1-day expiration and auto-close older issues Feb 5, 2026
Copilot AI requested a review from pelikhan February 5, 2026 13:25
@pelikhan pelikhan marked this pull request as ready for review February 5, 2026 13:27
Copilot AI review requested due to automatic review settings February 5, 2026 13:27
@pelikhan pelikhan merged commit 9ff2b5d into main Feb 5, 2026
6 checks passed
@pelikhan pelikhan deleted the copilot/set-pr-triage-expiration branch February 5, 2026 13:28
Copy link
Contributor

Copilot AI left a 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 converts the PR triage agent from creating GitHub Discussions to creating GitHub Issues, with automatic expiration after 1 day and automatic closure of older triage reports. This addresses issue #13861 with a correction from the originally requested 1-second expiration to a more practical 1-day expiration.

Changes:

  • Converted from create-discussion to create-issue for better lifecycle management with close-older-issues support
  • Added expires: 1d for 24-hour auto-closure via maintenance workflow
  • Added close-older-issues: true to ensure only the latest triage report remains open
  • Updated all messaging and documentation to reference "issue" instead of "discussion"

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/pr-triage-agent.md Source file changes: converted create-discussion to create-issue with expiration and auto-close configuration, updated success message and Phase 8 instructions
.github/workflows/pr-triage-agent.lock.yml Compiled workflow changes: updated frontmatter hash, safe outputs config, tool definitions, environment variables, and all references from create_discussion to create_issue

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

max: 1
category: "general"
title-prefix: "[PR Triage Report] "
expires: 1d
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description contains inconsistent information about the expiration time. The "Changes Made" section mentions "expires: 1s" but the actual code correctly implements "expires: 1d" (1 day). This is just a documentation issue in the PR description - the code changes are correct. Consider updating the PR description to remove references to "1s" and consistently use "1d" throughout.

Copilot uses AI. Check for mistakes.
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.

[PR Triage Report] 2026-02-05 - 1 PR Triaged

2 participants