Skip to content

Close inactive issues #1

Close inactive issues

Close inactive issues #1

Workflow file for this run

name: Lock Closed Issues
on:
workflow_dispatch
jobs:
lock-closed-issues:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Lock closed issues
run: |
# Get a list of all closed issues in the repository
issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/issues?state=closed" | jq -r '.[] | .number')
# Loop through each closed issue and lock it
for issue in $issues; do
curl -s -X PUT -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"locked":true}' "https://api.github.com/repos/${{ github.repository }}/issues/$issue/lock"
done