From 988ebf6c5de1f5404177cf9fb491de2183738e0f Mon Sep 17 00:00:00 2001 From: Kushal Das <daskushal980@gmail.com> Date: Sun, 27 Oct 2024 10:53:18 +0530 Subject: [PATCH] deleted package.lock.josn --- .github/workflows/close-old-issue.yml | 37 --------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/close-old-issue.yml diff --git a/.github/workflows/close-old-issue.yml b/.github/workflows/close-old-issue.yml deleted file mode 100644 index cd59651..0000000 --- a/.github/workflows/close-old-issue.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Close Old Issues -on: - schedule: - - cron: "0 0 * * *" - -jobs: - close-issues: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Close Old Issues - run: | - open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/issues?state=open" \ - | jq -r '.[] | .number') - for issue in $open_issues; do - # Get the last updated timestamp of the issue - last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/issues/$issue" \ - | jq -r '.updated_at') - days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 )) - if [ $days_since_update -gt 15 ]; then - curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - -d '{"state":"closed"}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/$issue" - - # Add a comment explaining when the issue will be closed - curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - -d '{"body":"This issue has been automatically closed due to inactivity for over 15 days. If you think it's still important, feel free to reopen it or submit a new issue. Thank you! 😊"}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments" - fi - done