auto-close-github-discussions.yml•1.14 kB
name: Auto Close Stale Discussions
on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Enables manual run from the Actions tab
permissions:
contents: read
discussions: write
jobs:
close-discussions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run inline Discussion Cleanup Script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLOSING_MESSAGE: |
Hi,
As we have not heard back from you, we are closing this discussion to keep our discussions organized.
Feel free to start a new discussion if this remains relevant.
Thank you for being part of the community!
run: node ./.github/workflows/scripts/auto-close-github-discussions.js