This repository was archived by the owner on Apr 9, 2026. It is now read-only.
[Genel] Tick fonksiyonunda return kullanıyorum ama hareket donuyor #13
This file contains hidden or 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
| name: Auto-Close AI-Labeled Issues | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| on: | |
| issues: | |
| types: [labeled, opened, reopened] | |
| workflow_dispatch: # Manuel tetikleme - mevcut open issue'ları kapatmak için | |
| permissions: | |
| issues: write | |
| jobs: | |
| close-ai-issue: | |
| name: Close issue if labeled 'ai' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if issue has 'ai' label and close it | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const issue = context.payload.issue; | |
| // workflow_dispatch ile manuel çalıştırıldıysa tüm 'ai' issue'ları tara | |
| if (context.eventName === 'workflow_dispatch') { | |
| console.log("Manuel çalıştırma: Tüm açık 'ai' issue'ları taranıyor..."); | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: 'ai', | |
| state: 'open', | |
| per_page: 100, | |
| }); | |
| console.log(`${issues.length} adet açık 'ai' issue'su bulundu.`); | |
| for (const iss of issues) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: iss.number, | |
| body: "## 🤖 Bu issue otomatik olarak kapatıldı.\n\n`ai` etiketine sahip olduğu için otomatik kapatma iş akışı tarafından kapatıldı.\n\nBu bir hata ise lütfen bir proje sorumlusuyla iletişime geçin.", | |
| }); | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: iss.number, | |
| state: 'closed', | |
| state_reason: 'not_planned', | |
| }); | |
| console.log(`✅ Issue #${iss.number} kapatıldı.`); | |
| } | |
| return; | |
| } | |
| // Normal event: issue'nun etiketlerini kontrol et | |
| const labels = issue.labels.map(l => l.name); | |
| console.log(`Issue #${issue.number} etiketleri: [${labels.join(', ')}]`); | |
| if (!labels.includes('ai')) { | |
| console.log("'ai' etiketi yok, işlem yapılmıyor."); | |
| return; | |
| } | |
| if (issue.state === 'closed') { | |
| console.log(`Issue #${issue.number} zaten kapalı.`); | |
| return; | |
| } | |
| console.log(`Issue #${issue.number} kapatılıyor...`); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| body: "## 🤖 Bu issue otomatik olarak kapatıldı.\n\n`ai` etiketine sahip olduğu için otomatik kapatma iş akışı tarafından kapatıldı.\n\nBu bir hata ise lütfen bir proje sorumlusuyla iletişime geçin.", | |
| }); | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| state: 'closed', | |
| state_reason: 'not_planned', | |
| }); | |
| console.log(`✅ Issue #${issue.number} başarıyla kapatıldı.`); |