Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add GitHub Action for automatic docs preview comments#20254

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
david-fraley wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromdf/docs-preview-comment-action

Conversation

david-fraley
Copy link
Collaborator

Summary

This PR adds a GitHub Action that automatically comments on pull requests with preview links when documentation files in thedocs/ directory are modified.

Implementation Details

The action:

  • Triggers on PR open, synchronize (new commits), and reopen events
  • Only runs when markdown files indocs/ are changed
  • Properly URI-encodes branch names (e.g.,df/claude-code-mod-v3df%2Fclaude-code-mod-v3)
  • Creates or updates a single comment with all changed documentation preview links
  • Follows the preview URL format:https://coder.com/docs/@{encoded-branch}/{doc-path}

Example

For a branch nameddf/claude-code-mod-v3 with changes todocs/ai-coder/tasks-core-principles.md, the action will comment:

📚 Documentation Preview Links

The following documentation pages have been modified and are available for preview:


Preview links are generated for branch:df/claude-code-mod-v3

Testing

The workflow has been tested locally for:

  • ✅ URI encoding of branch names with special characters
  • ✅ Proper URL generation matching the expected format
  • ✅ Handling multiple changed documentation files

Resolves

Addresses the request from@david-fraley to automatically comment preview links for documentation changes.

This action automatically comments on pull requests with preview linkswhen documentation files in the docs/ directory are modified.Features:- Triggers on PR open, synchronize, and reopen events- Only runs when docs/ markdown files are changed- URI-encodes branch names properly (e.g., slashes become %2F)- Creates or updates a single comment with all changed doc links- Preview URLs follow format:https://coder.com/docs/@{encoded-branch}/{doc-path}Example: Branch 'df/claude-code-mod-v3' with changes to'docs/ai-coder/tasks-core-principles.md' will generate:https://coder.com/docs/@df%2Fclaude-code-mod-v3/ai-coder/tasks-core-principles
@david-fraleydavid-fraley changed the titlefeat: Add GitHub Action for automatic docs preview commentsfeat: add GitHub Action for automatic docs preview commentsOct 9, 2025
Use environment variables instead of direct template expansion in bashcommands to prevent potential code injection attacks through branch names.This addresses the zizmor linter check for template injection vulnerabilities.
- Add persist-credentials: false to checkout action to prevent credential leaks- Quote GITHUB_OUTPUT variable to fix shellcheck warningsAddresses artipacked and shellcheck findings from CI linter.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@david-fraleydavid-fraley

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@david-fraley

[8]ページ先頭

©2009-2025 Movatter.jp