[FERN-SCRIBE] Add documentation on algolia integration #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: 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@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: .github/scripts/package.json | |
| - name: Install dependencies | |
| run: | | |
| cd .github/scripts | |
| npm install | |
| - 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@v7 | |
| 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@v7 | |
| 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.' | |
| }); |