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

Commit

Permalink
Merge pull request #7437 from vercel/autoreply
Browse files Browse the repository at this point in the history
Test workflow
  • Loading branch information
amyegan authored Jul 11, 2024
2 parents c9a4705 + 0f5c0f4 commit 38e40e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 50 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/auto-close.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: Close Stale Discussions
name: New Discussion Auto-lock

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
on:
discussion:
types: [locked]

jobs:
close-stale-discussions:
lock_discussion:
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)"'
- run: |
lockSucceeded="$(gh api graphql -F discussionId=$DISCUSSION_ID -f query='
mutation lock($discussionId:ID!) {
lockLockable(input: {lockableId:$discussionId}) {
actor {
login
}
lockedRecord {
activeLockReason
locked
}
}
}
' --jq '.data.lockLockable.lockedRecord.locked')"
echo "LOCKED =" $lockSucceeded
echo '${{ github.event.discussion.number }}' | jq -r '"https://github.com/vercel/community/discussions/\(.)"'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCUSSION_ID: ${{ github.event.discussion.node_id }}
24 changes: 0 additions & 24 deletions .github/workflows/auto-lock.yml

This file was deleted.

0 comments on commit 38e40e5

Please sign in to comment.