This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7437 from vercel/autoreply
Test workflow
- Loading branch information
Showing
2 changed files
with
25 additions
and
50 deletions.
There are no files selected for viewing
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
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 }} |
This file was deleted.
Oops, something went wrong.