Skip to content

Initial Draft Release of NaverPay Size Action

Latest
Compare
Choose a tag to compare
@2-one-week 2-one-week released this 06 Dec 09:07
· 12 commits to main since this release

We are excited to announce the initial draft release of the NaverPay Size Action, a custom GitHub Action designed to monitor and compare build sizes and dependency changes in pull requests. This action provides developers with detailed insights into how their code changes impact project size.


Key Features

  1. Pull Request Analysis

    • Automatically triggers on pull requests to compare build and dependency sizes between branches.
  2. Build Size Comparison

    • Analyze the size impact on Next.js applications with support for gzip and Brotli compression.
  3. Dependency Size Analysis

    • Detect changes in dependency sizes using npm view or Bundlephobia API.
  4. Customizable Reports

    • Options to:
      • Show or hide total size differences.
      • Collapse unchanged files in the markdown report.
      • Exclude unchanged files entirely.
  5. Multi-language Support

    • Supports English (en) and Korean (ko) for markdown comments.
  6. File Ignoring

    • Allows exclusion of specific files or patterns from the analysis using glob patterns.

Inputs Overview

Input Name Description Default Value
github_token GitHub token for authentication. Required
build_script The npm script to run for building your project. build
compression Compression method (gzip, brotli, or none). gzip
show_total Show the total size difference. true
collapse_unchanged Collapse unchanged files in the markdown report. true
omit_unchanged Exclude unchanged files from the markdown report. false
minimum_change_threshold Ignore changes below this threshold in bytes. 10 (packages), 1000 (Next.js)
ignore_patterns Glob patterns to ignore specific files or changes. None
language Language for markdown comments (en or ko). en

Example Workflow

name: Analyze Pull Request Size

on:
  pull_request:
    branches:
      - main

jobs:
  size-check:
    runs-on: ubuntu-latest
    steps:
      - name: Run Size Action
        uses: naverpay/size-action@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          build_script: build
          compression: gzip
          language: 'en'
          show_total: true
          collapse_unchanged: true
          omit_unchanged: false
          minimum_change_threshold: 1000
          ignore_patterns: |
            **/*.md
            **/*.test.js

Known Limitations

  1. Bundlephobia API Fallback:

    • If Bundlephobia API fails, the action will fallback to using npm view for dependency size retrieval.
    • If both methods fail, size information will not be reported.
  2. Compression Method:

    • Compression methods (gzip, brotli) require accurate build configuration for best results.

Feedback and Contribution

We welcome feedback and contributions to improve the action. Please report issues or suggestions on the [GitHub repository](#).

Let’s make monitoring and improving code size easier together! 🎉