Compare build artifacts between base and PR branches via GitHub Pull Request. This Action helps developers recognize artifact changes caused by their changes.
Example Repository
- https://github.com/Himenon/diff-artifacts-example
- https://github.com/Himenon/diff-artifacts-example-diff-viewer
Example Pull Requests
- Create a GitHub App with permissions: Pull requests (Read/Write), Contents (Read/Write)
- Save
APP_IDandAPP_PRIVATE_KEYas repository secrets - Create an empty repository for
diff-viewer
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"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.
