Composite GitHub Action to compare artifact file sizes
This action is a reusable combination of:
- Downloading the previous/base artifact (via
dawidd6/action-download-artifact) - Comparing it against your current build output path (file, directory, or simple glob pattern:
*,?,**) and writing a markdown report
Example usage:
- uses: KarbitsCode/artifact-comparer@main
id: compare
with:
artifact-name: windows-latest-build
path: ./out/**/*The action outputs:
comparison-resultJSON with base/head total size and delta- a GitHub Actions step summary table with per-file KB before/after and delta (
NEW/REMOVED/±n KB)
Implementation notes:
- the downloaded base artifact directory is automatically cleaned up at the end of the composite action (
if: always()cleanup step) - comparer logic runs inline via
actions/github-script(no action-local npm install/runtime dependencies) - downloading artifacts requires a token with workflow permission
actions: read(for examplepermissions: { actions: read }); by default this usesGITHUB_TOKEN, but you can pass a different token via thegithub-tokeninput if the default token is too restricted