Skip to content

feat(refactor): convert action to TypeScript, add ESLint & Jest#1

Merged
alexey1312 merged 2 commits intomainfrom
feature-ts
Jan 27, 2026
Merged

feat(refactor): convert action to TypeScript, add ESLint & Jest#1
alexey1312 merged 2 commits intomainfrom
feature-ts

Conversation

@alexey1312
Copy link
Copy Markdown
Collaborator

Description

Refactors the GitHub Action from JavaScript/shell to TypeScript with full type safety, adds ESLint and Prettier for code quality, and introduces Jest for unit testing.

  • Migrate core logic to TypeScript (src/index.ts, src/types.ts)
  • Add ESLint + Prettier configuration for linting and formatting
  • Add Jest with unit tests for output parsing and error handling
  • Update CI workflows for build and test automation
  • Add hk.pkl for pre-commit hooks configuration

Introduce TypeScript for improved type safety and consistency in
the codebase, replacing shell scripts with a single-node process. Add
ESLint for linting and Prettier for styling to maintain code quality.
Integrate Jest for unit testing and refactor the test workflow for
TypeScript compatibility. These changes improve code maintainability
and align with modern JavaScript/TypeScript practices.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @alexey1312, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request represents a significant refactoring of the GitHub Action, transitioning its entire implementation from a shell-script-based composite action to a TypeScript-based Node.js action. This change aims to improve the action's robustness, testability, and long-term maintainability by leveraging modern JavaScript tooling and practices. The update also introduces a more structured development environment with integrated linting, formatting, and unit testing, ensuring higher code quality and a more efficient contribution process.

Highlights

  • Core Logic Migration to TypeScript: The GitHub Action's core logic has been completely rewritten from shell scripts to TypeScript, enhancing type safety, maintainability, and developer experience. This includes new files like 'src/index.ts' for the main logic and 'src/types.ts' for type definitions.
  • Introduction of ESLint and Prettier: New configurations for ESLint and Prettier have been added ('eslintrc.json', '.prettierrc') to enforce consistent code style and identify potential issues, integrated into the development workflow via 'hk.pkl' and 'package.json' scripts.
  • Unit Testing with Jest: Jest has been integrated for unit testing, with a new configuration ('jest.config.js') and initial unit tests ('src/index.test.ts') covering key functions like output parsing, error categorization, and command building.
  • GitHub Action Definition Update: The 'action.yml' file has been updated to reflect the new architecture, switching from a 'composite' shell-based run to a 'node20' runtime that executes the compiled 'dist/index.js' file. All previous shell steps have been removed.
  • Streamlined Development Workflow: The 'mise.toml' file and new 'package.json' scripts consolidate development tasks for linting, formatting, testing, and building, simplifying the local development and CI processes. A new 'CONTRIBUTING.md' guide has also been added.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/release.yml
    • .github/workflows/test.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors the GitHub Action from shell scripts to TypeScript, enhancing maintainability, testability, and overall code quality. The introduction of ESLint, Prettier, and Jest provides a robust development environment with strong linting, formatting, and unit testing capabilities. The updated documentation and mise.toml tasks streamline the development workflow. The changes are well-structured and reflect a thorough migration to a more modern and type-safe approach for GitHub Actions development.

Comment thread src/index.ts
@alexey1312 alexey1312 merged commit 3cf9d44 into main Jan 27, 2026
5 checks passed
@alexey1312 alexey1312 deleted the feature-ts branch January 27, 2026 07:34
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.

1 participant