Skip to main content
In this lesson you’ll learn how to install a GitHub App into an organization repository to automate image optimization. Automating image compression reduces repository size, speeds up CI/CD, and improves site load times — all without manually editing each file. The example repository used in screenshots is ghas-guardrails-demo, which contains multiple images for a product demo. Manually optimizing many files can be time consuming; a GitHub App can scan the repo, optimize images, and open a pull request (PR) with the changes for review.
A dark-themed GitHub repository page showing the file tree (images folder) on the left and a preview of a starry "background.gif" on the right. The preview displays a black space background with small colored stars.

Why use an automation app?

  • Saves time: bulk-optimizes large numbers of images.
  • Preserves history: changes are proposed via PRs so you can review and merge.
  • Improves performance: smaller images reduce repo size and web load times.
  • Repeatable: runs automatically when new images are added.
Compare manual versus automated workflows:

Choose a Marketplace app

Open the GitHub Marketplace (for example, https://github.com/marketplace) and search for an image optimization app. For this demo we use Imgbot, which analyzes image files in your repository and compresses them to reduce size while preserving visual quality.
A dark‑themed screenshot of the GitHub Marketplace listing for "Imgbot." The page shows the app README explaining image optimization on the left and a right sidebar with install count, verification badge, tags, and a "Set up a free trial" button.
Imgbot and similar apps often offer an open-source tier that works on public repositories for free; private repositories may require a paid plan. Choose the plan that matches your repository visibility and organizational billing setup.
Open-source tiers typically operate only on public repositories. If you need optimization for private repositories, review the app’s pricing and billing options before installing.

Install and configure the app

During installation you can limit the app to specific repositories within an organization. In this example we install Imgbot into the game-devstudio organization and restrict it to the ghas-guardrails-demo repository. The installer displays requested permissions such as read access to repository metadata and read/write access to code and pull requests so the app can modify images and create PRs.
A dark-themed screenshot of a GitHub app installation dialog for adding an app to the organization "game-devstudio." It shows "Only select repositories" chosen with one repo selected and permissions including read access to metadata and read/write access to code and pull requests.
Review the requested permissions carefully before authorizing an app. For an image-optimizer the most common permissions are:
Granting write access lets the app create commits and pull requests. Only install apps from trusted vendors and verify the permissions requested before authorizing.
After confirming billing (if required) and authorizing the app for the selected repository, Imgbot will begin scanning the repository. The installation/confirmation screen typically shows a success message when setup completes.
A webpage screenshot from Imgbot displaying the message "That's it! You did it!" with a preview of a GitHub pull request showing image optimization results and size reductions. The page has small decorative bow-tie shapes along the sides.
You can always view, configure, suspend, or uninstall installed apps from your organization’s settings page.
A dark-themed GitHub organization settings page for "game-devstudio" showing the "Installed GitHub Apps" section. It lists the Imgbot app with a "Configure" button and a left-hand navigation menu of organization settings.

Review the automated pull request

It may take several minutes for the app to finish scanning and create a pull request. When Imgbot raises the PR, review the changes: the PR summary typically lists each optimized image, the original size, the optimized size, and the percent reduction — plus an overall reduction metric. In this demo the total reduction shown is about 7%.
A dark-themed GitHub pull request page for "ghas-guardrail-demo" showing an ImgBot PR titled "[ImgBot] Optimize images #8" with a bot comment "Beep boop. Your images are optimized!" and a table listing before/after file sizes and percent reductions.
Recommended PR review checklist:
  • Confirm the PR contains only image changes as expected.
  • Spot-check a few optimized images visually to ensure quality.
  • Verify the diff shows size reductions and no unintended metadata changes.
  • Merge the PR when you’re satisfied.

Troubleshooting & tips

  • If the app doesn’t run, check the organization’s billing and app installation scope.
  • For private repos, confirm the plan supports private repository optimization.
  • If you want different compression settings, check the app’s configuration options or repository-level config files the app supports.
This workflow — discover an app, install for the target organization/repository, grant necessary permissions, and review the automated PR — is the typical pattern for adding safe, auditable automation to a repository.

Watch Video