This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
New Discussion Auto-lock #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)"' |