Skip to content

Add pre-commit configuration and GitHub Actions for large file checks#37

Merged
mino-park7 merged 3 commits intomainfrom
hotfix-add-large-files-check-pre-commit
Feb 9, 2026
Merged

Add pre-commit configuration and GitHub Actions for large file checks#37
mino-park7 merged 3 commits intomainfrom
hotfix-add-large-files-check-pre-commit

Conversation

@mino-park7
Copy link
Copy Markdown
Contributor

Add pre-commit and .github workflow

Pre-commit 1MB 파일 체크 — 수행 결과 요약

목적

Git 저장소에 1MB를 초과하는 파일이 커밋되는 것을 막아 저장소 용량 증가를 방지합니다.


추가·수정된 항목

1. .pre-commit-config.yaml (신규)

  • : pre-commit-hookscheck-added-large-files
  • 제한: --maxkb=10241MB 초과 시 커밋 거부
  • 로컬에서 git commit 시 스테이징된 파일을 자동 검사

2. .github/workflows/check-large-files.yml (신규)

  • 실행 시점: main 브랜치에 대한 push, pull_request
  • 동작: pre-commit 설치 후 check-added-large-files만 실행 (--all-files로 전체 저장소 검사)
  • 로컬 pre-commit과 동일한 규칙을 CI에서도 적용

3. README.md (수정)

  • 목차에 「Pre-commit (1MB 초과 파일 체크)」 섹션 링크 추가
  • 해당 섹션에 설치·활성화·수동 실행 방법 및 GitHub Actions 설명 추가

사용 방법

# 최초 1회: pre-commit 설치 및 훅 등록
pip install pre-commit   # 또는 brew install pre-commit
pre-commit install

# 이후 커밋 시 자동 검사
git add .
git commit -m "..."   # 1MB 초과 파일이 있으면 커밋 거부

# 수동 실행
pre-commit run                           # 스테이징된 파일만
pre-commit run check-added-large-files --all-files   # 전체 저장소

참고

  • 기존 1MB 초과 파일: 저장소에 이미 있는 대용량 파일은 로컬 pre-commit은 “새로 스테이징된 파일”만 검사하므로 그대로 두어도 됨.
    CI 워크플로우는 --all-files로 전체를 검사하므로, 해당 파일이 있으면 워크플로우가 실패함.
    → 대용량 파일 압축·정리 후 push하거나, 정리 전까지 워크플로우를 비활성화할 수 있음.
  • 대용량 파일이 꼭 필요한 경우: Git LFS 사용 권장.

Image resize in pytorchcon2025-report (using Claude Code)

Image Optimization Summary

Date: 2025-02-08
Target: content/posts/pytorchcon2025-report/

Method

  • Tool: sips --resampleWidth 1600 (macOS built-in)
  • Max width를 1600px로 리사이즈 (1600px 이하 이미지는 변경 없음)
  • pre-commit 기준: --maxkb=1024 (1MB)

Results

File Before After Reduction
monarch.png 2.9M 831K 71%
SGLang.png 2.0M 831K 59%
spotify_vllm_tpu.png 1.4M 605K 58%
torchcomms.png 1.3M 629K 53%
ray.png 1.2M 559K 55%
executorch.png 1.2M 595K 52%
helion.png 1.1M 569K 50%
accelerator_privateuse.png 1.0M 498K 52%
vLLM.png 672K 321K 52%
cutile.png 353K 118K 67%
llm-d.png 152K 257K -
hyperaccel.png 963K 963K skipped (1024x600)
moscone_center.JPG 360K 360K skipped (1197x630)
dynamo.png 71K 71K skipped (960x962)

Total: ~14.5MB -> ~7.2MB (50% reduction)

All files are now under the 1MB pre-commit threshold.

- Introduced a pre-commit hook to prevent committing files larger than 1MB.
- Updated README to include instructions for setting up pre-commit.
- Added GitHub Actions workflow to enforce the same large file check on pushes and pull requests to the main branch.
- Updated several binary image files in the 'pytorchcon2025-report' directory.
@mino-park7 mino-park7 self-assigned this Feb 7, 2026
@mino-park7 mino-park7 requested a review from a team as a code owner February 7, 2026 15:37
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mino-park7, 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 establishes a robust system for managing repository size by preventing the addition of excessively large files. It integrates pre-commit hooks for local enforcement and a GitHub Actions workflow for continuous integration checks, both configured to reject files exceeding 1MB. Additionally, the README.md has been updated to guide contributors on using these new tools, and existing large images were proactively optimized to meet the new standards.

Highlights

  • Large File Prevention (Pre-commit): Introduced a new .pre-commit-config.yaml file to configure a pre-commit hook that automatically checks for and prevents the commit of individual files larger than 1MB (1024KB).
  • Large File Prevention (GitHub Actions): Implemented a new GitHub Actions workflow (.github/workflows/check-large-files.yml) that enforces the same 1MB file size limit on main branch pushes and pull requests, scanning the entire repository to ensure compliance.
  • Documentation Update: Updated the README.md to include comprehensive instructions on how to install, activate, and manually run the pre-commit hooks, along with an explanation of the GitHub Actions integration for large file checks.
  • Image Optimization: Optimized existing images within the pytorchcon2025-report directory, reducing their total size by approximately 50% (from ~14.5MB to ~7.2MB) to ensure all images are now under the 1MB file size threshold.
Changelog
  • .pre-commit-config.yaml
    • Added a new configuration file to define pre-commit hooks.
    • Configured the check-added-large-files hook from pre-commit-hooks to reject files larger than 1024KB (1MB).
  • README.md
    • Added a new entry to the table of contents for "Pre-commit (1MB 초과 파일 체크)".
    • Included a detailed new section explaining the installation and activation of pre-commit, its operational behavior, manual execution commands, and the role of the GitHub Actions workflow for large file checks.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/check-large-files.yml
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
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
Contributor

@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

이 PR은 pre-commit과 GitHub Actions를 도입하여 1MB를 초과하는 파일이 저장소에 추가되는 것을 방지하는 좋은 변경입니다. 이를 통해 저장소 용량을 효율적으로 관리할 수 있습니다. 몇 가지 설정 오류와 문서상의 개선점을 발견하여 리뷰 코멘트를 남겼습니다. 특히 .pre-commit-config.yaml의 버전 오류는 훅 설치를 불가능하게 하므로 반드시 수정이 필요합니다. 제안된 내용을 확인하고 반영해 주시기 바랍니다.


jobs:
check-large-files:
runs-on: ubuntu-latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

runner를 runner-base로 사용하시는건 어떨까요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

반영했습니다~!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

queueing이 엄청 기네요

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

넵, 이게 원래 이렇게 오래 기다리지는 않는데 뭔가 이상한 것 같습니다...! 제가 한 번 확인해보겠습니다!

Copy link
Copy Markdown
Contributor

@YoungHoonJun YoungHoonJun left a comment

Choose a reason for hiding this comment

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

LGTM!!!

@mino-park7 mino-park7 merged commit b2233f4 into main Feb 9, 2026
1 check passed
@mino-park7 mino-park7 deleted the hotfix-add-large-files-check-pre-commit branch February 9, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants