Close GitHub issues that have not reached configurable upvote thresholds after a configured age.
The default policy is designed for feature requests:
- Close issues that are at least 6 months old with 5 or fewer upvotes.
- Close issues that are at least 12 months old with fewer than 10 upvotes.
Only open issues with the configured label are considered. Pull requests are ignored.
name: Close Low Demand Feature Requests
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
inputs:
dry-run:
description: Log matching issues without closing them
required: false
default: false
type: boolean
permissions:
contents: read
issues: write
jobs:
close-low-demand-issues:
runs-on: ubuntu-latest
steps:
- uses: pocket-id/low-demand-closer@v1
with:
label: needs more upvotes
issue-type: Feature
dry-run: ${{ inputs['dry-run'] || false }}| Input | Default | Description |
|---|---|---|
github-token |
${{ github.token }} |
Token with issues: write permission. |
label |
needs more upvotes |
Only issues with this label are considered. |
issue-type |
Feature |
Only issues with this issue type are considered. Set to an empty string to disable issue type filtering. |
rules |
See below | JSON array of demand rules. |
dry-run |
false |
Log matching issues without commenting or closing. |
comment |
See action.yml |
Comment template posted before closing. |
Default rules:
[
{ "months": 6, "upvotes": 5, "operator": "<=" },
{ "months": 12, "upvotes": 10, "operator": "<" }
]Rules support the < and <= operators.
Install dependencies with:
npm ciBuild the runtime JavaScript with:
npm run buildRun tests with:
npm testThe action is authored in TypeScript under src/, but GitHub Actions runs the compiled JavaScript in dist/. Commit dist/ whenever the TypeScript source changes.