-
Notifications
You must be signed in to change notification settings - Fork 77
feat: automate CLAUDE.md generation from RFC discussions #2199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: stalniy <[email protected]>
Co-authored-by: stalniy <[email protected]>
Co-authored-by: stalniy <[email protected]>
|
|
||
| - name: Commit Changes | ||
| if: steps.check-changes.outputs.has_changes == 'true' | ||
| run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue(blocking): can you commit using git cli tool, this will be much simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 4a9b7e9. Simplified the workflow to use git CLI for commits with git commit and git push instead of the GitHub API.
| CATEGORY=$(gh api graphql -f query=' | ||
| query($owner: String!, $repo: String!, $number: Int!) { | ||
| repository(owner: $owner, name: $repo) { | ||
| discussion(number: $number) { | ||
| category { | ||
| name | ||
| } | ||
| } | ||
| } | ||
| }' -F owner="${GITHUB_REPOSITORY%/*}" -F repo="${GITHUB_REPOSITORY#*/}" -F number="$DISCUSSION_NUMBER" --jq '.data.repository.discussion.category.name') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question(blocking): don't you have category in github.event.discussion context variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4a9b7e9. Now using github.event.discussion.category.name directly in the job condition instead of making a separate API call.
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue(blocking): no need to fetch everything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 4a9b7e9. Removed fetch-depth: 0 from checkout action since we only need the latest commit.
script/generate-claude-md.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue(blocking): this script is overcomplicate, it's probably better to write it in ts and use node --experimental-strip-types flag to run it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 4a9b7e9. Rewrote the script in TypeScript and now using node --experimental-strip-types to run it, which is much cleaner and type-safe.
- Replace bash script with TypeScript version using --experimental-strip-types - Use git CLI for commits instead of GitHub API - Use github.event.discussion.category.name directly instead of fetching - Remove fetch-depth: 0 as it's not needed - Simplify workflow with single job Co-authored-by: stalniy <[email protected]>
Implements GitHub Actions automation to generate CLAUDE.md from RFC discussions labeled
RFC:Landed, providing AI coding assistants with project-specific contribution guidelines.Changes
Script:
script/generate-claude-md.ts--experimental-strip-typesfor direct executiongh cliGraphQL API## AI Instructionssections from RFC:Landed discussions.contribution-guidelines/with lowercase-dashed namingCLAUDE.mdwith@.contribution-guidelines/[filename].mdlinksWorkflow:
.github/workflows/generate-claude-md.ymllabeled,unlabeled,editedeventsgithub.event.discussion.category.namefrom event contextgit commit,git push) for commits instead of GitHub APIautomated/claude-md-updatebranch (no direct commits)Documentation
.contribution-guidelines/README.md: System overview and usageCONTRIBUTING.md: Added AI Coding Guidelines sectionExample Output
When an RFC titled "Testing Strategy" gets the
RFC:Landedlabel:Generated
.contribution-guidelines/testing-strategy.md:Generated
CLAUDE.md:Usage
## AI Instructionssection with guidance for AI toolsRFC:LandedlabelOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.