-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (76 loc) · 3.14 KB
/
fern-scribe.yml
File metadata and controls
86 lines (76 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Fern Scribe Documentation Assistant
on:
issues:
types: [opened, edited]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
fern-scribe:
if: contains(github.event.issue.labels.*.name, 'fern-scribe')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: .github/scripts/package.json
- name: Clean install dependencies
run: |
cd .github/scripts
rm -rf node_modules package-lock.json
npm install
# --- NEW STEP: Generate my-mappings.md ---
- name: Generate Fern URL Mappings
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
cd .github/scripts
node generate-mappings.js
# -----------------------------------------
- name: Run Fern Scribe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TURBOPUFFER_API_KEY: ${{ secrets.TURBOPUFFER_API_KEY }}
TURBOPUFFER_ENDPOINT: ${{ secrets.TURBOPUFFER_ENDPOINT }}
TURBOPUFFER_NAMESPACE: ${{ secrets.TURBOPUFFER_NAMESPACE }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SLACK_USER_TOKEN: ${{ secrets.SLACK_USER_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_TITLE: ${{ github.event.issue.title }}
REPOSITORY: ${{ github.repository }}
run: |
cd .github/scripts
node fern-scribe.js
- name: Comment on issue
if: success()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🌿 **Fern Scribe is working on your request!**\n\nI\'ve analyzed your documentation request and am preparing file updates. A draft PR will be created shortly with the proposed changes.\n\n*Powered by AI and TurboBuffer file discovery*'
});
- name: Comment on failure
if: failure()
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ **Fern Scribe encountered an error**\n\nThere was an issue processing your documentation request. Please check the action logs and try again.\n\nIf the problem persists, please contact the maintainers.'
});