Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

New Discussion Auto-lock #1

New Discussion Auto-lock

New Discussion Auto-lock #1

Workflow file for this run

name: Close Stale Discussions
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch:
inputs:
days-before-stale:
description: 'Number of days before a discussion is considered stale.'
default: '90'
required: true
type: string
jobs:
close-stale-discussions:
runs-on: ubuntu-latest
steps:
- name: Run action
id: autoclose
uses: steffen-karlsson/[email protected]
with:
message: '' # Close without comment
days-before-close: ${{ inputs.days-before-stale }}
close-unanswered: true
close-reason: 'OUTDATED'
verbose: true
- name: Show Output
run: |
echo '${{ steps.autoclose.outputs.stale-discussions }}' | jq -r '"Closed \(length) stale discussions: "'
echo '${{ steps.autoclose.outputs.stale-discussions }}' | jq -r '"- https://github.com/vercel/community/discussions/\(.[].number)"'