Skip to content

A GitHub Action that compares and visualizes build artifact differences between base and PR branches directly in pull requests.

License

Notifications You must be signed in to change notification settings

Himenon/diff-artifacts

Repository files navigation

Diff Artifacts

日本語

Compare build artifacts between base and PR branches via GitHub Pull Request. This Action helps developers recognize artifact changes caused by their changes.

Diff Viewer Example

Example Repository

Example Pull Requests

Setup

  1. Create a GitHub App with permissions: Pull requests (Read/Write), Contents (Read/Write)
  2. Save APP_ID and APP_PRIVATE_KEY as repository secrets
  3. Create an empty repository for diff-viewer

Usage

Compare artifacts

on:
  pull_request:

jobs:
  compare:
    runs-on: ubuntu-latest
    steps:
      - uses: Himenon/diff-artifacts/compare@v1.1.0
        with:
          app-id: ${{ secrets.APP_ID }}
          app-private-key: ${{ secrets.APP_PRIVATE_KEY }}
          diff-viewer-owner: "your-username"
          diff-viewer-repo-name: "your-diff-viewer-repo"

You can also configure workflows for uploading base artifacts and auto-closing PRs:

Upload base artifacts

on:
  push:
    branches: [main]

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      # build steps ...
      - uses: Himenon/diff-artifacts/upload@v1.1.0
        with:
          path: dist/

Auto-close PRs created by diff-artifacts

on:
  pull_request:
    types: [closed]

jobs:
  cleanup:
    runs-on: ubuntu-slim
    steps:
      - uses: Himenon/diff-artifacts/close-pr@v1.1.0
        with:
          app-id: ${{ secrets.APP_ID }}
          app-private-key: ${{ secrets.APP_PRIVATE_KEY }}
          diff-viewer-owner: "your-username"
          diff-viewer-repo-name: "your-diff-viewer-repo"

Developer's Notes

For production use, we recommend cloning this repository or forking it within your organization for customization. The default options are designed to work with minimal configuration and are not intended for complex workflows.

License

Himenon/diff-artifacts, MIT

About

A GitHub Action that compares and visualizes build artifact differences between base and PR branches directly in pull requests.

Topics

Resources

License

Stars

Watchers

Forks

Languages