Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/scripts/fern-scribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,10 @@ ${filesUpdated.map(file => `- \`${file}\``).join('\n')}

if (pr && pr.html_url) {
console.log(` ✅ Draft PR created: ${pr.html_url}`);
if (process.env.GITHUB_OUTPUT) {
const fs = require('fs');
fs.appendFileSync(process.env.GITHUB_OUTPUT, `pr-number=${pr.number}\n`);
}
} else {
console.log(` ⚠️ PR creation failed`);
}
Expand Down Expand Up @@ -2106,4 +2110,4 @@ const fernScribeGitHub = new FernScribeGitHub();
fernScribeGitHub.run().catch(error => {
console.error('Fatal error:', error);
process.exit(1);
});
});
18 changes: 17 additions & 1 deletion .github/workflows/fern-scribe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
# -----------------------------------------

- name: Run Fern Scribe
id: fern-scribe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TURBOPUFFER_API_KEY: ${{ secrets.TURBOPUFFER_API_KEY }}
Expand Down Expand Up @@ -72,6 +73,21 @@ jobs:
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: Enable Pull Request Automerge
if: success() && steps.fern-scribe.outputs.pr-number
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.fern-scribe.outputs.pr-number }}
merge-method: squash

- name: Approving PR
if: success() && steps.fern-scribe.outputs.pr-number
env:
GH_TOKEN: ${{ secrets.PR_BOT_GH_PAT }}
run: |
echo "Approving PR"
gh pr review ${{ steps.fern-scribe.outputs.pr-number }} --approve

- name: Comment on failure
if: failure()
uses: actions/github-script@v7
Expand All @@ -82,4 +98,4 @@ jobs:
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.'
});
});