Skip to content

A Github Action to Analyse your static image files and warns if the size increase the threshold size. It check for .jpg, .svg, .png, .gif, .jpeg files.

License

Notifications You must be signed in to change notification settings

bharatpe/assets-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assets Checker

A Github Action to Analyse your static image files on generating Pull Request and warns if the size increase the threshold size. It check for .jpg, .svg, .png, .gif, .jpeg files.

Install

npm i or yarn install

Build

npm i @vercel/ncc -g
npm run build

Output Stats

Success -

Screenshot 2022-08-24 at 4 49 47 PM

Failure -

Screenshot 2022-08-24 at 4 49 39 PM

.assets-ignore file

Might be we have some images which size greater then the threshold we provided, in this case we can ignore these files by using .assets-ignore file.

.assets-ignore file must present inside the root directory of your repo :

Screenshot 2022-08-24 at 4 49 39 PM

The ignore assets name must be add as full path and separate - separate lines:

Screenshot 2022-08-24 at 4 49 39 PM

Usage:

Checkout action.yml

Please check the below code for detailed usage:

steps:
      - uses: bharatpe/assets-checker@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          target_folder: src/assets
          thrashold_size: 100

By default github actions work on node 12.For a specific node version use:

- uses: actions/setup-node@v1
        with:
          node-version: '16.16.0'

Ex:

steps:
      - uses: actions/setup-node@v1
        with:
          node-version: '16.16.0'
      - uses: bharatpe/assets-checker@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          target_folder: src/assets
          thrashold_size: 100

Also check Demo.yml for complete configuration(on using github actions)

License

The scripts and documentation in this project are released under the MIT License

About

A Github Action to Analyse your static image files and warns if the size increase the threshold size. It check for .jpg, .svg, .png, .gif, .jpeg files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published