mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-24 22:38:02 -05:00
stale.yml only removes the label when its daily run gets back to an issue or PR, which can take a few days. A new workflow removes it when a user comments on an open item that has the label. The stale bot also checks exemptions before activity, so a stale item that later gets an assignee or milestone, becomes a draft, or loses "wait for response" is never checked again and keeps its label. A new step in stale.yml removes the label from those.
87 lines
3.8 KiB
YAML
87 lines
3.8 KiB
YAML
name: Stale issues and PRs
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "30 1 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
actions: write # save the run state in the actions cache
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
# Overlapping runs would overwrite each other's saved progress.
|
|
concurrency:
|
|
group: stale
|
|
|
|
jobs:
|
|
stale:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/stale@v11
|
|
with:
|
|
# Each stale label or close costs about 2 operations and posts one
|
|
# comment, so 800 stays under GitHub's limit of 500 comments an hour.
|
|
# Runs that stop early continue from the same place the next day.
|
|
operations-per-run: 800
|
|
ascending: true
|
|
stale-issue-label: stale
|
|
stale-pr-label: stale
|
|
remove-stale-when-updated: true
|
|
|
|
# The last step mirrors the exempt and only-labels options below.
|
|
# Update its filters when they change.
|
|
|
|
# Issues
|
|
days-before-issue-stale: 90
|
|
days-before-issue-close: 14
|
|
close-issue-reason: not_planned
|
|
exempt-all-issue-assignees: true
|
|
exempt-all-issue-milestones: true
|
|
stale-issue-message: |
|
|
This issue has had no activity for 90 days, so it will be closed in 14 days.
|
|
|
|
If it's a bug that still happens on the latest OrcaSlicer release, please leave a comment with the version you tested. If it's a feature request you still want, please leave a comment saying so. Either one keeps it open.
|
|
close-issue-message: |
|
|
This issue was closed because there was no activity after the reminder.
|
|
|
|
If it still matters to you, leave a comment here and a team member can reopen it, or open a new issue with the details.
|
|
|
|
# PRs: only PRs where we asked the author for something
|
|
only-pr-labels: "wait for response"
|
|
days-before-pr-stale: 90
|
|
days-before-pr-close: 14
|
|
exempt-draft-pr: true
|
|
exempt-all-pr-assignees: true
|
|
exempt-all-pr-milestones: true
|
|
delete-branch: false
|
|
stale-pr-message: |
|
|
We asked for changes or more information on this PR, and there has been no activity for 90 days. It will be closed in 14 days.
|
|
|
|
To keep it open, leave a comment. If you push new commits, please also leave a short comment so we know it's ready for another look. If you no longer have time for it, that is fine, just let us know.
|
|
close-pr-message: |
|
|
This PR was closed because we did not hear back after the reminder. Thank you for the work you put into it.
|
|
|
|
If you want to continue, push your changes and reopen it, or open a new PR.
|
|
|
|
# The stale bot checks exemptions before activity, so it never comes back
|
|
# to a stale item that became exempt. Remove the label from those here.
|
|
- name: Remove stale labels the stale bot will not revisit
|
|
if: ${{ !cancelled() }}
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
{
|
|
gh issue list -R "$GITHUB_REPOSITORY" --label stale --state open --limit 5000 \
|
|
--json number,assignees,milestone \
|
|
--jq '.[] | select((.assignees | length > 0) or .milestone != null) | .number'
|
|
gh pr list -R "$GITHUB_REPOSITORY" --label stale --state open --limit 1000 \
|
|
--json number,isDraft,assignees,milestone,labels \
|
|
--jq '.[] | select(.isDraft or (.assignees | length > 0) or .milestone != null
|
|
or ([.labels[].name] | index("wait for response") | not)) | .number'
|
|
} | while read -r n; do
|
|
gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$n/labels/stale" --silent < /dev/null ||
|
|
echo "::warning::Could not remove the stale label from #$n"
|
|
done
|