From 6c171ac722cb7f370e89933c7b481c491d7da4e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:49:41 +0000 Subject: [PATCH 1/2] Initial plan From 6158df29abc23721e74835623f3ddb483284767e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:54:19 +0000 Subject: [PATCH 2/2] Add workflow for closing issues with user inactivity Co-authored-by: devinschumacher <45643901+devinschumacher@users.noreply.github.com> --- .github/workflows/close-inactive-issues.yml | 81 +++++++++++++++++++ ...call-close-inactive-issues.properties.json | 7 ++ .../call-close-inactive-issues.yml | 24 ++++++ 3 files changed, 112 insertions(+) create mode 100644 .github/workflows/close-inactive-issues.yml create mode 100644 workflow-templates/call-close-inactive-issues.properties.json create mode 100644 workflow-templates/call-close-inactive-issues.yml diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml new file mode 100644 index 0000000..9b3461a --- /dev/null +++ b/.github/workflows/close-inactive-issues.yml @@ -0,0 +1,81 @@ +name: Close Issues with User Inactivity + +on: + workflow_call: + inputs: + days_before_close: + description: 'Number of days of user inactivity before closing issues' + required: false + default: 10 + type: number + stale_issue_message: + description: 'Message to post when marking issues as stale due to user inactivity' + required: false + default: 'This issue has been automatically marked as stale because we have not received a response from the issue author for {{days-before-stale}} days. We are waiting for your input to continue helping you. If you are still experiencing this issue, please comment to keep it open. Otherwise, it will be closed automatically in a few days.' + type: string + close_issue_message: + description: 'Message to post when closing stale issues' + required: false + default: 'This issue has been automatically closed due to lack of response from the issue author. If you are still experiencing this issue, please feel free to reopen it or create a new issue with the requested information.' + type: string + exempt_issue_labels: + description: 'Comma-separated list of labels that exempt issues from being closed' + required: false + default: 'pinned,security,waiting-for-maintainer,under-investigation' + type: string + close_issue_reason: + description: 'Reason for closing the issue' + required: false + default: 'not_planned' + type: string + secrets: + GITHUB_TOKEN: + description: 'GitHub token with issue management permissions' + required: true + +jobs: + check-and-close-inactive: + runs-on: ubuntu-latest + permissions: + issues: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Close issues with user inactivity + uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + # Configuration for issues only + days-before-stale: ${{ inputs.days_before_close }} + days-before-close: 1 # Close 1 day after marking as stale + + # Disable PR handling + days-before-pr-stale: -1 + days-before-pr-close: -1 + + # Messages + stale-issue-message: ${{ inputs.stale_issue_message }} + close-issue-message: ${{ inputs.close_issue_message }} + + # Labels and exemptions + stale-issue-label: 'stale-user-inactive' + exempt-issue-labels: ${{ inputs.exempt_issue_labels }} + + # Remove stale label when user responds + remove-stale-when-updated: true + + # Close issues with specified reason + close-issue-reason: ${{ inputs.close_issue_reason }} + + # Configuration to improve targeting + ascending: true + operations-per-run: 50 + + # Only process issues that don't have recent activity from the author + # This helps ensure we're only closing when waiting for user response + ignore-updates: false + ignore-issue-updates: false \ No newline at end of file diff --git a/workflow-templates/call-close-inactive-issues.properties.json b/workflow-templates/call-close-inactive-issues.properties.json new file mode 100644 index 0000000..eaed2f2 --- /dev/null +++ b/workflow-templates/call-close-inactive-issues.properties.json @@ -0,0 +1,7 @@ +{ + "name": "call-close-inactive-issues", + "description": "Automatically close issues with user inactivity after 10 days", + "iconName": "issue-closed", + "categories": ["automation", "issues"], + "filePatterns": ["*.md", "README.md"] +} \ No newline at end of file diff --git a/workflow-templates/call-close-inactive-issues.yml b/workflow-templates/call-close-inactive-issues.yml new file mode 100644 index 0000000..0e8a0e6 --- /dev/null +++ b/workflow-templates/call-close-inactive-issues.yml @@ -0,0 +1,24 @@ +name: Close Issues with User Inactivity + +on: + schedule: + # Run daily at 2 AM UTC to check for inactive issues + - cron: '0 2 * * *' + workflow_dispatch: + inputs: + days_before_close: + description: 'Days of user inactivity before closing' + required: false + default: '10' + type: string + +jobs: + close-inactive: + uses: serpapps/.github/.github/workflows/close-inactive-issues.yml@main + with: + days_before_close: ${{ github.event.inputs.days_before_close && fromJSON(github.event.inputs.days_before_close) || 10 }} + stale_issue_message: 'This issue has been automatically marked as stale because we have not received a response from you for {{days-before-stale}} days. We are waiting for your input to continue helping you. If you are still experiencing this issue, please comment to keep it open. Otherwise, it will be closed automatically tomorrow.' + close_issue_message: 'This issue has been automatically closed due to lack of response from the issue author. If you are still experiencing this issue, please feel free to reopen it or create a new issue with the requested information.' + exempt_issue_labels: 'pinned,security,waiting-for-maintainer,under-investigation,enhancement' + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file