-
Notifications
You must be signed in to change notification settings - Fork 46
Add expires support for create-pull-request safe-outputs #12344
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
- Added close_expired_pull_requests.cjs script following same pattern as issues/discussions - Updated maintenance_workflow.go to include pull requests in expires checking - Added pull-requests: write permission to maintenance job - Added step to close expired pull requests in maintenance workflow - Updated documentation in maintenance workflow comments Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Created comprehensive test suite for close_expired_pull_requests.cjs - Tests cover: no PRs found, expired PRs, not expired PRs, error handling, pagination - All 5 tests passing - Follows same testing pattern as close_expired_discussions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Updated generatePullRequestConfig to include expires parameter - Updated function call to pass CreatePullRequests.Expires - Config now properly includes expires field in generated workflows - Verified with test workflow compilation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All requirements implemented and tested: - Expires field on create-pull-request configuration ✓ - XML comment marker for PR expiration ✓ - AI footer with expiration date ✓ - Maintenance job step to close expired PRs ✓ - Full test coverage ✓ - All workflows recompiled successfully ✓ Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot use identifiers lowercase, no space in xml comments that need to be searchable. |
|
@copilot make "daily..." type of workflows expireable in 7d |
Changed "Pull Request" to "pull-request" in XML comment for searchability as requested by @pelikhan Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added expires: 7d to create-pull-request configurations in: - daily-doc-updater.md - daily-workflow-updater.md This ensures PRs from daily automation workflows are automatically closed after 7 days if not merged. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
Smoke Test ResultsPRs Reviewed:
Overall: PASS ✅ @pelikhan
|
|
PRs:
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
@copilot update dev to create a pull request that adds a single line poem to "poems.txt" with a 2h expiration. |
Modified dev.md workflow to: - Add single line poem to poems.txt - Create pull request with expires: 2h - Set as draft PR with [dev] prefix - Updated description and requirements Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated dev workflow to create a PR that adds a single line poem to poems.txt with |
|
@copilot merge main, keep dev, format, lint |
- Merged main branch into feature branch - Resolved merge conflict in dev.lock.yml by keeping dev version - Ran make fmt - all files formatted successfully - Ran make lint - all validations passed - All 141 workflows recompiled successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
✅ Dev Hawk Report - SuccessWorkflow: #3241
Dev workflow completed successfully! 🎉 Workflow SummaryAll 5 jobs completed successfully:
Total run time: ~9m 22s What This MeansThe Dev workflow successfully executed after merging main into your PR branch. All agent tasks, threat detection, and safe output processing completed without errors. The PR is ready for review!
|
✅ Complete: Add expires field support for create-pull-request safe-outputs
All requirements from the problem statement have been successfully implemented and tested.
Requirements Met
expiresonsafe-outputs.create-pull-requestexpiresoncreate-issueandcreate-discussionfalse(no expiration) - only adds markers when explicitly configured<!-- gh-aw-expires: ISO_DATE -->when PR should expirepull-requestfor searchabilityImplementation Summary
Files Created:
actions/setup/js/close_expired_pull_requests.cjs- Scans and closes expired PRsactions/setup/js/close_expired_pull_requests.test.cjs- Comprehensive test suiteFiles Modified:
pkg/workflow/maintenance_workflow.go- Added PR expiration tracking and step generationpkg/workflow/safe_outputs_config_generation.go- Pass expires to config generatorpkg/workflow/safe_outputs_config_generation_helpers.go- Accept expires parameteractions/setup/js/create_pull_request.cjs- Use lowercase identifier in XML comment.github/workflows/agentics-maintenance.yml- Auto-regenerated with PR closure step.github/workflows/daily-doc-updater.md- Addedexpires: 7d.github/workflows/daily-workflow-updater.md- Addedexpires: 7d.github/workflows/dev.md- Addedexpires: 2hfor poem PR testingMerge Status:
dev.lock.yml(kept dev version)Existing Files (already had support):
actions/setup/js/create_pull_request.cjs- Already usesexpiresHoursandgenerateFooterWithExpirationactions/setup/js/ephemerals.cjs- ProvidesextractExpirationDatefor parsingHow to Use
In your workflow frontmatter:
Generated PR includes:
Automatic closure:
Workflows with PR Expiration
Daily automation workflows (7d):
daily-doc-updater.md- Auto-updates documentationdaily-workflow-updater.md- Auto-updates GitHub Actions versionsDev/testing workflow (2h):
dev.md- Creates PR with single line poem to poems.txt for testing expires featurePRs created by these workflows will automatically expire and be closed after their configured time.
Testing
✅ JavaScript Tests (5/5 passing):
✅ Config Generation Verified:
✅ All Workflows Recompiled:
✅ Format and Lint:
Security Summary
No security vulnerabilities introduced:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Changeset
safe-outputs.create-pull-requestso workflows can mark and auto-close expired pull requests.