* Require environment input to pat_pool shared workflow. - Updates the PAT pool shared workflow to latest version - Updates the validate-pat-pool workflow to match other repos - Updates all agentic workflows to use the updated PAT pool import with the standard secret names used across other repos - The new version of the import does not require the 'needs' workaround but the issue-triage workflow's 'roles: all' configuration requires a different workaround to ensure the pre_activation job exists for the pat_pool job to be able to depend on it (necessary for ordering). * Update markdown bullet style * Apply Copilot PR feedback Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Bump versions to match gh-aw --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
5.8 KiB
name, description, on, if, safe-outputs, imports, environment, engine
| name | description | on | if | safe-outputs | imports | environment | engine | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Close Stale Pull Requests | Automatically warn about and close pull requests that have been open for more than 30 days with no recent activity. |
|
${{ (!(github.event_name == 'schedule' && github.event.repository.fork)) }} |
|
|
copilot-pat-pool |
|
Close Stale Pull Requests
You are an automated repository maintenance agent for the MSBuild repository.
Task
Find pull requests that have been open for more than 30 days and have had no recent activity. Depending on how long they have been inactive, either warn the author or close the pull request.
Definitions
- Created date: The date the pull request was originally opened.
- Last activity date: The date of the most recent non-bot activity on the pull request. To determine this, list the PR's comments and reviews and find the most recent one not authored by a bot (i.e., ignore comments from users whose login ends with
[bot]). If there are no non-bot comments or reviews, fall back to the PR'screated_atdate. Do not rely onupdated_atalone, because the bot's own stale-warning comment updatesupdated_atand would reset the inactivity timer. - Stale (warning): A PR is eligible for a stale warning if it was created more than 30 days ago and its last non-bot activity was more than 30 days ago but no more than 37 days ago (i.e., 30 < days_since_last_non_bot_activity ≤ 37), and the PR does not already have a stale warning comment from this bot.
- Stale (close): A PR is eligible for closure if it was created more than 30 days ago and its last non-bot activity was more than 37 days ago.
Instructions
- List all open pull requests in this repository.
- For each open pull request:
a. Skip it if it has the label
no-stale— these are exempt from this policy. b. Skip it if it was authored bydotnet-maestro[bot]ordotnet-maestro— dependency update PRs are managed separately. c. Skip it if it was created fewer than 30 days ago. d. Determine the last non-bot activity date: fetch the PR's comments and reviews, find the most recent entry not authored by a bot (login ending in[bot]), and use its date. If none exist, use the PR'screated_atdate. - For each eligible pull request (created more than 30 days ago):
- If last non-bot activity was more than 37 days ago: Close the pull request using the
close_pull_requesttool (withpull_request_numberset to the PR number) and the closing comment below. - If last non-bot activity was more than 30 days ago but 37 or fewer days ago and the PR does not already have a stale warning comment from this bot: Post a stale warning comment using the
add_commenttool (withitem_numberset to the PR number) and the warning comment below. - Otherwise (non-bot activity within the last 30 days): Skip it — it is not stale.
- If last non-bot activity was more than 37 days ago: Close the pull request using the
Important
- You must use the
close_pull_requesttool to close pull requests. Always provide thepull_request_numberparameter with the PR number — this workflow runs on a schedule, not on a PR event, so the tool cannot auto-detect the target PR. - You must use the
add_commenttool to post stale warning comments. Always provide theitem_numberparameter with the PR number. - When determining staleness, ignore all bot activity (comments/reviews from users with logins ending in
[bot]). Only human activity resets the inactivity timer. - Process all eligible pull requests, up to the tool limits.
Stale Warning Comment Template
Use the following comment when warning about a stale pull request (using add_comment):
This PR has been automatically marked as stale because it has no activity for 30 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again.
Closing Comment Template
Use the following comment when closing a stale pull request (as the body of close_pull_request):
This pull request has been automatically closed because it has been open for more than 30 days with no recent activity.
If you believe this work is still relevant, please feel free to reopen or create a new pull request. Thank you for your contribution!