Skip to content

Commit bccbf63

Browse files
Enable auto-merge for Fern Scribe PRs
Co-Authored-By: [email protected] <[email protected]>
1 parent adcb871 commit bccbf63

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/scripts/fern-scribe.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,10 @@ ${filesUpdated.map(file => `- \`${file}\``).join('\n')}
20632063

20642064
if (pr && pr.html_url) {
20652065
console.log(` ✅ Draft PR created: ${pr.html_url}`);
2066+
if (process.env.GITHUB_OUTPUT) {
2067+
const fs = require('fs');
2068+
fs.appendFileSync(process.env.GITHUB_OUTPUT, `pr-number=${pr.number}\n`);
2069+
}
20662070
} else {
20672071
console.log(` ⚠️ PR creation failed`);
20682072
}
@@ -2106,4 +2110,4 @@ const fernScribeGitHub = new FernScribeGitHub();
21062110
fernScribeGitHub.run().catch(error => {
21072111
console.error('Fatal error:', error);
21082112
process.exit(1);
2109-
});
2113+
});

.github/workflows/fern-scribe.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
# -----------------------------------------
4545

4646
- name: Run Fern Scribe
47+
id: fern-scribe
4748
env:
4849
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4950
TURBOPUFFER_API_KEY: ${{ secrets.TURBOPUFFER_API_KEY }}
@@ -72,6 +73,21 @@ jobs:
7273
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*'
7374
});
7475
76+
- name: Enable Pull Request Automerge
77+
if: success() && steps.fern-scribe.outputs.pr-number
78+
uses: peter-evans/enable-pull-request-automerge@v3
79+
with:
80+
pull-request-number: ${{ steps.fern-scribe.outputs.pr-number }}
81+
merge-method: squash
82+
83+
- name: Approving PR
84+
if: success() && steps.fern-scribe.outputs.pr-number
85+
env:
86+
GH_TOKEN: ${{ secrets.PR_BOT_GH_PAT }}
87+
run: |
88+
echo "Approving PR"
89+
gh pr review ${{ steps.fern-scribe.outputs.pr-number }} --approve
90+
7591
- name: Comment on failure
7692
if: failure()
7793
uses: actions/github-script@v7
@@ -82,4 +98,4 @@ jobs:
8298
owner: context.repo.owner,
8399
repo: context.repo.repo,
84100
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.'
85-
});
101+
});

0 commit comments

Comments
 (0)