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

New Discussion Auto-lock #3

New Discussion Auto-lock

New Discussion Auto-lock #3

Workflow file for this run

name: New Discussion Auto-lock
on:
discussion:
types: [locked]
jobs:
lock_discussion:
runs-on: ubuntu-latest
steps:
- 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 }}