Skip to content

refactor: remove duplicate prompt file, read document_command.md at runtime#43

Merged
oaustegard merged 2 commits intomainfrom
claude/github-ai-readme-action-beNGA
Mar 2, 2026
Merged

refactor: remove duplicate prompt file, read document_command.md at runtime#43
oaustegard merged 2 commits intomainfrom
claude/github-ai-readme-action-beNGA

Conversation

@oaustegard
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits March 2, 2026 19:33
Adds a three-job GitHub Actions workflow that uses the official
actions/ai-inference@v1 action (backed by GitHub Models / GPT-4o)
to automatically create or update a *_README.md file whenever a
bookmarklet .js file is added or modified on the main branch.

Workflow (.github/workflows/auto_readme.yml):
  - detect-changes: diffs HEAD vs HEAD~1, finds root-level .js
    changes, and emits a JSON matrix of {js_file, basename,
    readme_file} entries
  - generate-readme: matrix job (max-parallel 3); uses
    actions/ai-inference with file-input to inject the bookmarklet
    source into the prompt template, then uploads the result as a
    GitHub artifact
  - commit-readmes: collects artifacts, rebases, and commits all
    generated READMEs in a single push back to main using the
    github-actions[bot] identity

Prompt template (.github/prompts/readme.prompt.yml):
  - Encodes the full project README structure (Purpose, Features,
    Installation w/ Easy/Manual mode, Usage, How It Works, Source
    Code, MIT footer) as a system prompt
  - Uses {{filename}}, {{basename}}, {{readme_filename}}, and
    {{bookmarklet_code}} template variables
  - Sets temperature=0.3 and maxCompletionTokens=2000 for
    consistent, focused output

No external secrets needed — workflow uses the built-in GITHUB_TOKEN
with the new models: read permission scope (GA since April 2025).
…untime

The separate .github/prompts/readme.prompt.yml duplicated instructions
already maintained in .claude/commands/document_command.md.

Now the workflow reads document_command.md directly at runtime, keeping
a single source of truth for README structure and style guidelines.
The prompt is constructed inline in a Python step and sent to the
GitHub Models API via GITHUB_TOKEN (models: read permission).
@oaustegard oaustegard merged commit 507719a into main Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants