Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs: add a new github action that automatically adds a docs preview #17282

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

Closed
wants to merge 18 commits into from

Conversation

EdwardAngert
Copy link
Contributor

No description provided.

@EdwardAngert EdwardAngert added docs Area: coder.com/docs docs/site docs site-related issue/task/feature request labels Apr 7, 2025
@EdwardAngert EdwardAngert self-assigned this Apr 7, 2025
EdwardAngert and others added 17 commits April 7, 2025 14:14
…k.yml

Improved the docs-preview-link workflow with comprehensive GitHub Actions best practices including:
- Enhanced security controls with proper environment configuration
- Better image detection and tracking for docs PRs
- Cross-platform compatibility for file operations
- Advanced git configuration for performance
- Content-based caching for better efficiency
- Document structure analysis for better context
- Improved error handling and self-validation
- Standardized metrics reporting
- Enhanced artifact handling for cross-job communication

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Created a reusable composite action for documentation analysis that can be used across any docs-related workflows. The action:

- Only runs on files in docs/ directory or markdown files
- Provides robust metrics for documentation changes
- Tracks image changes with better reporting
- Generates document structure analysis
- Identifies the most significant changes
- Returns standardized outputs with comprehensive metrics

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Enhanced the docs-analysis composite action with several GitHub Actions best practices:
- Added input validation to prevent command injection
- Implemented path sanitization for safer file operations
- Created retry logic for git operations to handle rate limiting
- Enhanced cross-platform compatibility with fallbacks
- Added repository size detection with adaptive throttling
- Implemented Python integration for safer JSON handling
- Added execution time tracking and performance metrics
- Created comprehensive documentation with examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Replace manual docs analysis with composite action in docs-preview-link
- Add missing output fields to docs-analysis action
- Update variable references in workflow to use composite outputs
- Add integration guide for documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Implement strict whitelist input validation for branch references
- Add path traversal detection to sanitize_path function
- Replace eval with direct command execution in git_with_retry
- Add error tracing with line numbers for better debugging
- Add performance monitoring and metrics generation
- Update README with security enhancements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Update workflow description to mention security features
- Add throttling and performance parameters to docs-analysis
- Add detailed image metrics to job summary
- Add most changed file information to reports
- Add performance metrics section to job summary
- Add execution time reporting from composite action

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fixed Python code in analyze_docs.py to use external script
- Improved error handling when script isn't found
- Added proper fallback mechanism for Python-based analysis
- Fixed command injection vulnerabilities in analyze_docs.py for better security

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add external Python script for document structure analysis
- Improves maintainability by separating Python code from YAML
- Handles document heading counts and title extraction
- Includes error handling for corrupted files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Change 'timing' id to 'execution_timing' to avoid duplicate IDs
- Update references to the step ID throughout the action
- Fix value reference in outputs section for execution-time

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Change from whitelist to blacklist validation approach
- Allow more characters commonly used in branch names
- Still maintain protection against command injection
- Block only potentially dangerous characters

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Replace regex pattern with simple string comparisons
- Check for specific unsafe shell characters individually
- Provide more explicit validation for shell injection characters
- Fix syntax error in conditional expression

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Correctly using  syntax instead of  in Markdown links within Bash here-documents to ensure proper variable expansion.
Uses SHA-pinned reference to force GitHub Actions to fetch the latest version of the custom action, preventing cache issues.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Replace composite action with inline Bash steps
- Simplify file analysis algorithm to avoid dependency on accurate git
history
- Fix error with document structure analysis

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: EdwardAngert <[email protected]>
Co-authored-by: Claude <[email protected]>
@EdwardAngert
Copy link
Contributor Author

closing in favor of #17317 and then #17322

@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs/site docs site-related issue/task/feature request docs Area: coder.com/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant