Skip to content

Commit

Permalink
Stale issue workflow improvements (#409)
Browse files Browse the repository at this point in the history
* Creating a new workflow to handle extending stale deadlines and some tweaks to identifying stale issues

* Apply suggestions from code review

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
  • Loading branch information
aaronpowell and Copilot authored Jan 29, 2025
1 parent c5f8d87 commit 5da31f0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/remove-stale-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Remove stale label on comment

on:
issue_comment:
types: [created]

permissions:
issues: write
pull-requests: write

jobs:
remove-stale-label:
if: github.event.comment.body == '/stale-extend'
runs-on: ubuntu-latest
steps:
- name: Remove stale label from pull request
uses: "actions/github-script@v7"
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: 'stale'
});
if: github.event_name == 'pull_request'

- name: Remove stale label from issue
uses: "actions/github-script@v7"
with:
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
name: 'stale'
});
if: github.event_name == 'issue'
26 changes: 22 additions & 4 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,45 @@ jobs:

steps:
- uses: actions/stale@v9
name: Standard issue and PR stale bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 21
days-before-close: 14
enable-statistics: true
any-of-labels: "Awaiting Response"
exempt-issue-labels: "awaiting-response"
exempt-pr-labels: "awaiting-response"
remove-stale-when-updated: true
stale-issue-message: "We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it."
stale-pr-message: "We have noticed this PR has not been updated within 21 days. If there is no action on this PR in the next 14 days, we will automatically close it."
stale-issue-message: "We have noticed this issue has not been updated within 21 days. If there is no action on this issue in the next 14 days, we will automatically close it. You can use `/stale-extend` to extend the window."
stale-pr-message: "We have noticed this PR has not been updated within 21 days. If there is no action on this PR in the next 14 days, we will automatically close it. You can use `/stale-extend` to extend the window."
close-issue-message: "This issue has been stale for 5 weeks and has been automatically closed."
close-pr-message: "This PR has been stale for 5 weeks and has been automatically closed."
stale-issue-label: "stale"
stale-pr-label: "stale"

- uses: actions/stale@v9
name: Question and Resolved issue stale bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 5
days-before-close: 2
enable-statistics: true
only-issue-labels: "Question,Resolved"
remove-stale-when-updated: true
stale-issue-message: "We have noticed this issue has been resolved for 5 days. If there is not action on this issue in the next 2 days, we will automatically close it."
stale-issue-message: "We have noticed this issue has been resolved for 5 days. If there is no action on this issue in the next 2 days, we will automatically close it. You can use `/stale-extend` to extend the window."
stale-issue-label: "stale"

- uses: actions/stale@v9
name: Awaiting response issue and PR stale bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 7
days-before-close: 3
enable-statistics: true
only-issue-labels: "awaiting-response"
only-pr-labels: "awaiting-response"
remove-stale-when-updated: true
stale-issue-message: "We have noticed this issue has been awaiting response for 7 days. If there is no action on this issue in the next 3 days, we will automatically close it. You can use `/stale-extend` to extend the window."
stale-pr-message: "We have noticed this PR has been awaiting response for 7 days. If there is no action on this PR in the next 3 days, we will automatically close it. You can use `/stale-extend` to extend the window."
stale-issue-label: "stale"
stale-pr-label: "stale"

0 comments on commit 5da31f0

Please sign in to comment.