1
0

auto-reply-issue.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Auto Reply to Issues
  2. on:
  3. issues:
  4. types: [labeled]
  5. permissions:
  6. issues: write
  7. contents: read
  8. # Limit concurrent runs to prevent rate limit issues
  9. concurrency:
  10. group: auto-reply-${{ github.event.issue.number }}
  11. cancel-in-progress: false
  12. jobs:
  13. auto-reply:
  14. # Only trigger when 'ai-reply' label is added; skip bot-created issues and issues already labeled 'copilot'
  15. if: |
  16. github.event.label.name == 'ai-reply' &&
  17. github.event.issue.user.login != 'github-actions[bot]' &&
  18. !contains(github.event.issue.labels.*.name, 'copilot')
  19. runs-on: ubuntu-latest
  20. # Increased timeout to 10 minutes to accommodate multiple API calls, file I/O, and network latency.
  21. timeout-minutes: 10
  22. steps:
  23. - uses: actions/checkout@v4
  24. - name: Multi-turn AI Response
  25. id: ai_response
  26. uses: actions/github-script@v8
  27. with:
  28. github-token: ${{ secrets.GITHUB_TOKEN }}
  29. script: |
  30. const fs = require('fs');
  31. const path = require('path');
  32. const script = require('./.github/scripts/issue-ai-response.js');
  33. await script({ github, context, core, fs, path });
  34. env:
  35. OPENAI_URL: ${{ vars.OPENAI_URL }}
  36. OPENAI_KEY: ${{ secrets.OPENAI_KEY }}