Add SkillLens GitHub Action based on SPEC.md#3
Conversation
- Update action.yml with SkillLens inputs/outputs and branding - Add @actions/github dependency for GitHub API access - Implement main.ts with: - Review data fetching (inline comments, reviews, conversations) - Code fence redaction and noise filtering - OIDC token retrieval for backend authentication - Proxy API call with proper error handling - PR comment upsert logic (create/update with marker) - Add comprehensive unit tests with 96%+ coverage - Create test fixtures for mocking GitHub API - Bundle TypeScript to dist/index.js Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>
…llance-github-action
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: ivan-magda <8586063+ivan-magda@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…e several packages, including @actions/cache to version 4.1.0 and @azure/core-auth to version 1.10.1. This also includes updates to various other Azure packages and improvements in license declarations across dependencies.
…nd package-lock.json
Update the test-action job in ci.yml to use the correct SkillLens action inputs (skilllens-api-url) and outputs (topics-json, comment-url) instead of the old template code. Exclude CLAUDE.md and SPEC.md from super-linter as these are project documentation files that don't need to follow strict markdown/terminology rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The test-action job was failing with "GITHUB_TOKEN is required" error. This fix adds the required permissions (pull-requests: write, issues: write, id-token: write) to the job and passes GITHUB_TOKEN as an environment variable to the action. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…reflect new percentage of 96.96%
…erage badge to 97.05%; enhance debug logging in main.ts for better troubleshooting
…ion; update API URL in main.ts to a constant; adjust tests accordingly; update coverage badge to reflect new percentage of 97.02%
All inputs already have defaults defined in action.yml, so the fallback values in code (|| 'default') were redundant. Simplified code to rely on action.yml defaults as the single source of truth.
- Network errors (DNS, connection failures) now respect fail-on-proxy-error flag - Previously network errors always failed the workflow regardless of the setting - Refactored to eliminate duplicate fail-on-proxy-error input reading - Added test coverage for network error scenarios with both flag states - Coverage remains at 97.27% 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Added test case to cover lines 185-186 in src/main.ts which handle the error when GITHUB_TOKEN is not provided. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Downgrade pull-requests permission from write to read in CI workflow - Update documentation in CLAUDE.md and SPEC.md to reflect correct permissions - Action only reads PR data and writes comments via issues API - Follows principle of least privilege for security
Replace logical OR (||) with nullish coalescing (??) operator when handling review.submitted_at timestamps. This ensures only null or undefined values fallback to empty string, not other falsy values, following JavaScript/TypeScript best practices.
- Renamed action to 'SkillLens: PR Review Learning & Developer Growth' for clarity. - Enhanced description to reflect the action's functionality in transforming PR feedback into personalized learning paths. - Updated package.json to change the name and description, and added relevant keywords for better discoverability. - Revamped README to provide a comprehensive overview of SkillLens, including usage instructions, features, and benefits, while improving the overall structure and clarity.
- Changed the SkillLens API URL from the original endpoint to a new Replit URL in main.ts. - Updated the test to reflect the new API URL, ensuring that the mock fetch call aligns with the change.
There was a problem hiding this comment.
Pull Request Overview
This PR implements the SkillLens GitHub Action based on the SPEC.md specification, transforming PR review feedback into personalized learning recommendations. The implementation replaces the template's wait functionality with a comprehensive system that fetches review data from GitHub APIs, calls a SkillLens proxy with OIDC authentication, and creates/updates PR comments with educational resources.
- Complete core functionality implementation including GitHub API integration, OIDC authentication, and comment management
- Comprehensive test suite with 96%+ coverage for all major components and error scenarios
- Updated metadata, configuration, and documentation to reflect the new SkillLens purpose
Reviewed Changes
Copilot reviewed 14 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/main.ts |
Complete rewrite implementing core SkillLens functionality (data fetching, normalization, API calls, comment management) |
src/wait.ts |
Removed template wait functionality (no longer needed) |
action.yml |
Updated metadata with SkillLens inputs/outputs and branding |
package.json |
Updated project metadata, added @actions/github dependency, and enhanced keywords |
__tests__/main.test.ts |
Comprehensive test suite covering all functionality and edge cases |
__tests__/wait.test.ts |
Removed obsolete wait function tests |
__fixtures__/github.ts |
Added GitHub API mocking fixtures for testing |
__fixtures__/core.ts |
Added getIDToken mock for OIDC testing |
README.md |
Complete rewrite with SkillLens documentation, usage examples, and FAQs |
SPEC.md |
Minor formatting and content clarifications |
CLAUDE.md |
Added comprehensive development guidance document |
.prettierignore |
Added exclusions for documentation files |
.github/workflows/linter.yml |
Updated to exclude documentation files from linting |
.github/workflows/ci.yml |
Updated test workflow with proper permissions and SkillLens inputs |
Comments suppressed due to low confidence (1)
src/main.ts:1
- The comment on line 182 in SPEC.md mentions the API URL should be 'https://api.skilllens.dev/v1/recommendations', but the actual implementation uses a different URL. There's an inconsistency between the specification and implementation.
import * as core from '@actions/core'
|
|
||
| const SKILLLENS_API_URL = |
There was a problem hiding this comment.
The hardcoded API URL appears to be pointing to a Replit development environment, which may not be stable for production use. Consider making this configurable via an input parameter or using a production API endpoint.
| const SKILLLENS_API_URL = | |
| // Make the API URL configurable via environment variable, fallback to default (Replit dev endpoint) | |
| const SKILLLENS_API_URL = | |
| process.env.SKILLLENS_API_URL || |
| const data = (await resp.json()) as { | ||
| topics: unknown[] |
There was a problem hiding this comment.
The topics array is typed as 'unknown[]' which provides no type safety. Consider defining a proper interface for the topic structure to improve type safety and code maintainability.
| const data = (await resp.json()) as { | |
| topics: unknown[] | |
| interface Topic { | |
| // Define the expected properties of a topic here. | |
| // For example: | |
| id: string; | |
| name: string; | |
| description?: string; | |
| // Add more fields as needed based on API response. | |
| } | |
| const data = (await resp.json()) as { | |
| topics: Topic[] |
- Fix MD051: Update anchor links to match actual section IDs - Fix MD029: Use consistent ordered list numbering (style: one) - Fix MD013: Break long line in code example - Fix MD034: Convert bare email to proper markdown link - Fix MD033: Configure markdownlint to allow GitHub-friendly HTML elements - Fix terminology: Replace 'repo' with 'repository' throughout - Fix terminology: Replace 'VS Code' with 'Visual Studio Code' - Run prettier formatting on tables for better alignment All linting checks now pass successfully.
Implementation Plan for SkillLens GitHub Action
Based on SPEC.md, implementing the following changes:
Implementation complete! The action now:
Note: dist files and SPEC.md have been reverted to their original state.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.