Skip to content

Commit b1dbb67

Browse files
trwalkebgavrilMS
authored andcommitted
Add GitHub Actions workflow for auto-answering issues
This action will attempt to answer questions customers have when posted on the repo.
1 parent 50aa1a3 commit b1dbb67

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Auto-Answer Issues
2+
3+
on:
4+
issues:
5+
types: [opened, labeled]
6+
7+
permissions:
8+
issues: write
9+
contents: read
10+
11+
jobs:
12+
answer-issue:
13+
runs-on: ubuntu-latest
14+
# Optional: only run for issues with a specific label
15+
# if: contains(github.event.issue.labels.*.name, 'question')
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- name: Install dependencies
26+
run: npm install @octokit/rest openai
27+
28+
- name: Generate and post response
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
32+
ISSUE_NUMBER: ${{ github.event.issue.number }}
33+
ISSUE_TITLE: ${{ github.event.issue.title }}
34+
ISSUE_BODY: ${{ github.event.issue.body }}
35+
REPO_OWNER: ${{ github.repository_owner }}
36+
REPO_NAME: ${{ github.event.repository.name }}
37+
run: node .github/scripts/answer-issue.js

0 commit comments

Comments
 (0)