stale issue / pull request is one which does not have activity for X time duration.
Add stale label to an issue / pull request and close it if it remains inactive after stale labeling
The following configuration checks for a non-stale issue/pull request if it has been inactive for more than one month then add the stale label.
If after this labeling, the stale issue/pull request remains inactive for more 7 days, then a comment to the issue/pull request is made, notifying of the inactivity, and closes it.
description: Stale issue/pull request
- name: labeled-as-stale
description: Issue/Pull request has stale label
spec: '$isElementOf("stale", $labels())'
- name: stale-issue-or-pr-handling
- rule: '!$rule("labeled-as-stale") && $lastEventAt() < 30 days ago'
- '$info("This issue is stale.")'
- rule: '$rule("labeled-as-stale") && $lastEventAt() < 7 days ago'
- '$commentOnce("Closing because this issue has been inactive for more than one month.")'
In order to have the automation for
stale issues / pull requests working properly we need to update our reviewpad action by adding a cron job to schedule the stale test.
# Run every day at midnight
- cron: "0 0 * * *"
- name: Reviewpad