super-productivity/.github/workflows/stale-discussions.yml
Corey Newton 4889a5a2ea
chore: limit "resolved" actions to correct categories (#7679)
GH Action will incorrectly mark discussions without the question-answer
format as answered when that is not possible. The action should be fixed
but restricting to the correct categories will also avoid this problem.
2026-05-19 15:55:29 +02:00

52 lines
2.1 KiB
YAML

---
name: Close Stale Discussions
'on':
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
inputs:
days-before-close:
description: 'days-before-close: number of days of inactivity before closing a discussion'
required: false
default: '0'
type: string
dry-run:
description: 'dry-run: when checked, no discussions will be closed'
default: true
type: boolean
permissions:
discussions: write
jobs:
close-stale-discussions:
runs-on: ubuntu-latest
steps:
- name: resolve-answered
uses: zenoprax/stalesweeper@c9c72ef0504f835bf9bf8ed7319d3bc149539291 # v1.1.2
env:
DAYS_BEFORE_CLOSE: ${{ github.event_name == 'schedule' && '90' || github.event.inputs.days-before-close }}
DRY_RUN: ${{ github.event_name == 'schedule' && 'false' || github.event.inputs.dry-run }}
with:
categories: 'Q&A,General'
close-reason: 'RESOLVED'
days-before-close: '${{ env.DAYS_BEFORE_CLOSE}}'
dry-run: ${{ env.DRY_RUN }}
message: >-
This discussion was automatically closed because it is answered and has had no further activity in ${{ env.DAYS_BEFORE_CLOSE}} days.
If the topic is still relevant, please start a new discussion.
- name: close-unanswered
uses: zenoprax/stalesweeper@c9c72ef0504f835bf9bf8ed7319d3bc149539291 # v1.1.2
env:
DAYS_BEFORE_CLOSE: ${{ github.event_name == 'schedule' && '180' || github.event.inputs.days-before-close }}
DRY_RUN: ${{ github.event_name == 'schedule' && 'false' || github.event.inputs.dry-run }}
with:
close-reason: 'OUTDATED'
close-unanswered: 'true'
days-before-close: '${{ env.DAYS_BEFORE_CLOSE}}'
dry-run: ${{ env.DRY_RUN }}
exempt-labels: 'documentation gap'
message: >-
This discussion was automatically closed because it has been inactive for ${{ env.DAYS_BEFORE_CLOSE}} days.
If the topic is still relevant, please reference this in a new discussion with more context or detail.