Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
image

GitHub Action

Tinify Image Action

v1.3.0

Tinify Image Action

image

Tinify Image Action

Compress and resize images with the Tinify API

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Tinify Image Action

uses: namoscato/[email protected]

Learn more about this action in namoscato/action-tinify

Choose a version

Tinify Image Action

GitHub Action to compress and resize images with the Tinify API.

Example commit

Features

  • filters PNG and JPEG files in a commit or pull request
  • optionally scales images proportionally
  • sets Exif metadata to prevent duplicate compressions
  • pushes commit with compression metrics

Usage

name: image
on:
  pull_request:
jobs:
  compress:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
      - uses: namoscato/action-tinify@v1
        with:
          api_key: ${{ secrets.TINIFY_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

The following workflow events are supported:

  • pull_request
  • pull_request_target
  • push

Inputs

input description
api_key Tinify API key (create one here)
github_token GITHUB_TOKEN secret
commit_user_name Git user.name, defaults to github.actor
commit_user_email Git user.email, defaults to <github.actor>@users.noreply.github.com
commit_message Custom commit message, defaults to Compress image(s)
resize_width Maximum target image width
resize_height Maximum target image height