Skip to content

Conversation

@Boxuan-Matty-Lin
Copy link
Owner

This pull request introduces a new GitHub Actions workflow for continuous integration (CI), ensuring code quality through automated linting and TypeScript type checking on pushes and pull requests to the main branch. The workflow is optimized to ignore documentation changes and supports concurrency control to avoid redundant runs.

CI workflow setup and quality checks:

  • Added a .github/workflows/CI.yml file that defines a CI workflow triggered on pushes and pull requests to main, excluding documentation changes.
  • Configured the workflow to check out code, set up pnpm and Node.js, install dependencies, and run both linting and TypeScript type checks to enforce code quality.
  • Implemented concurrency control to cancel in-progress CI runs for the same branch or PR, reducing unnecessary resource usage.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a GitHub Actions CI workflow to automate code quality checks through linting and TypeScript type checking on pushes and pull requests to the main branch. The workflow includes optimizations for ignoring documentation changes and implements concurrency control to prevent redundant runs.

  • Added a new CI workflow with automated linting and type checking
  • Configured pnpm and Node.js 20 for dependency management
  • Implemented concurrency control and path filtering for documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

run: pnpm lint

- name: Type check
run: pnpm tsc --noEmit
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] The package.json only has a lint script but does not have a tsc script. The command pnpm tsc --noEmit will work if TypeScript is installed, but it would be more maintainable to add a typecheck or type-check script to package.json (e.g., "typecheck": "tsc --noEmit") and call it here as pnpm typecheck. This ensures consistency and makes it easier to modify type-checking behavior in one place.

Suggested change
run: pnpm tsc --noEmit
run: pnpm typecheck

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The pull-requests: write permission is granted but never used in this workflow. The workflow only performs linting and type checking without any PR-related write operations (like posting comments). Consider removing this unnecessary permission to follow the principle of least privilege.

Suggested change
pull-requests: write

Copilot uses AI. Check for mistakes.
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The fetch-depth: 0 fetches the entire Git history, which is unnecessary for linting and type checking. This increases CI runtime and resource usage. Consider using the default shallow clone (fetch-depth: 1) or removing this parameter entirely unless there's a specific need for full history (e.g., for changelog generation or commit analysis).

Suggested change
fetch-depth: 0
fetch-depth: 1

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +51
- name: Verify pnpm
run: pnpm -v

Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] The "Verify pnpm" step that runs pnpm -v appears to be a debugging/verification step that doesn't add value to the CI workflow. If pnpm setup fails, subsequent steps would fail anyway. Consider removing this step to simplify the workflow.

Suggested change
- name: Verify pnpm
run: pnpm -v

Copilot uses AI. Check for mistakes.
@Boxuan-Matty-Lin Boxuan-Matty-Lin merged commit b7db600 into main Nov 19, 2025
6 of 7 checks passed
@Boxuan-Matty-Lin Boxuan-Matty-Lin deleted the CI-workflow branch November 19, 2025 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants