Skip to content

docs(product tours): Update docs for draft auto-save system #145

docs(product tours): Update docs for draft auto-save system

docs(product tours): Update docs for draft auto-save system #145

Workflow file for this run

name: Inkeep Feedback Collector
on:
pull_request:
types: [closed]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
collect-feedback:
# Only run if PR was merged, not closed
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check for Inkeep interactions
id: check_inkeep
uses: actions/github-script@v7
with:
script: |
const prNumber = context.payload.pull_request.number;
// Get all comments on the PR
const issueComments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber
});
// Get all review comments
const reviewComments = await github.rest.pulls.listReviewComments({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
// Get all reviews
const reviews = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
// Check if any comment/review mentioned @inkeep
const hadInkeepMentions =
issueComments.data.some(c => c.body.includes('@inkeep')) ||
reviewComments.data.some(c => c.body.includes('@inkeep')) ||
reviews.data.some(r => (r.body || '').includes('@inkeep'));
console.log(`PR #${prNumber} had Inkeep mentions: ${hadInkeepMentions}`);
return hadInkeepMentions;
- name: Post feedback request
if: steps.check_inkeep.outputs.result == 'true'
uses: actions/github-script@v7
with:
script: |
const prNumber = context.payload.pull_request.number;
const author = context.payload.pull_request.user.login;
const feedbackComment = `## Inkeep feedback
Thanks for working with the Inkeep bot, @${author}! Now that this PR is merged, we'd love your quick feedback to improve the experience.
### Rate your experience (1-5):
**Initial draft accuracy:**
_(1 = very inaccurate, 5 = excellent)_
**Editing needed:**
_(1 = minimal tweaks, 5 = complete rewrite)_
**What would make this more helpful?**
---
*Just reply to this comment with your ratings and tag @PostHog/team-docs-wizard. Thanks for helping us improve this workflow!*
</details>`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: feedbackComment
});
console.log(`Posted feedback request on PR #${prNumber}`);