{"id":15690798,"url":"https://github.com/carlosperate/bloaty-action","last_synced_at":"2026-03-08T08:33:14.102Z","repository":{"id":65614718,"uuid":"594860070","full_name":"carlosperate/bloaty-action","owner":"carlosperate","description":"GitHub Action to run Bloaty McBloatface: a size profiler for binaries ","archived":false,"fork":false,"pushed_at":"2023-10-18T10:26:47.000Z","size":2195,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-08T00:07:14.177Z","etag":null,"topics":["actions","bloaty","github-actions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/bloaty-action","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlosperate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-29T21:09:49.000Z","updated_at":"2023-11-22T15:25:48.000Z","dependencies_parsed_at":"2024-10-23T23:00:05.960Z","dependency_job_id":"3d448ce8-1e24-4ab7-806b-470efc051bcc","html_url":"https://github.com/carlosperate/bloaty-action","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.040000000000000036","last_synced_commit":"270d0aa10dac8ebe328352390723b7520168ac16"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fbloaty-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fbloaty-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fbloaty-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosperate%2Fbloaty-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosperate","download_url":"https://codeload.github.com/carlosperate/bloaty-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973690,"owners_count":21834108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","bloaty","github-actions"],"created_at":"2024-10-03T18:16:19.708Z","updated_at":"2026-03-08T08:33:14.065Z","avatar_url":"https://github.com/carlosperate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bloaty McBloatface GitHub Action\n\nGitHub Action to run Google's Bloaty McBloatface - a size profiler for\nbinaries: https://github.com/google/bloaty/\n\n```yaml\n- name: Run Bloaty McBloatface on an ELF file\n  uses: carlosperate/bloaty-action@v1\n  with:\n    bloaty-args: \u003cpath_to_your_file_and_any_bloaty_flags\u003e\n```\n\n- 🧑‍💻 Additional examples, including Job Summaries and PR comments, can be\n  found in the \"[Additional Action Examples](#additional-action-examples)\"\n  section.\n- 🐳 A Bloaty Docker image (`ghcr.io/carlosperate/bloaty`) is also provided,\n  more info in the\n  \"[Using the Docker Image to run Bloaty directly](#using-the-docker-image-to-run-bloaty-directly)\" section.\n\n\n## Action Inputs/Outputs\n\nInputs:\n- `bloaty-args`: **(Required)** All arguments to pass to Bloaty McBloatface.\n- `output-to-summary`: *(Optional, default `false`)* Boolean (`true` or `false`) to include\n  the bloaty output in the [GitHub Actions Job Summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/).\n- `summary-title`: *(Optional, default `\"bloaty output\"`)* If\n  `output-to-summary` is enabled, this is the title on top of the bloaty output.\n\nOutputs:\n- `bloaty-output`: A string with the output from Bloaty McBloatface\n- `bloaty-output-encoded`: The bloaty output string with escaped characters (so you'll get things like `\\n`). It can be easier to pass this to other action steps.\n\n\n## Using the Docker image to run Bloaty directly\n\nThis repository contains two Dockerfiles and the two Docker images are hosted in\nthe [GitHub Docker Container registry](https://github.blog/2020-09-01-introducing-github-container-registry/).\n\nThe [`ghcr.io/carlosperate/bloaty`](docker-bloaty/) Docker image contains the\nbloaty application on its own, and can be used used to easily run `bloaty`\ndirectly in your own environment or applications.\n\nFor example, to diff two ELF files contained in this repo, you can run the\nfollowing command from this repository root directory:\n\n```bash\ndocker run --rm -v $(pwd):/home ghcr.io/carlosperate/bloaty:latest test-elf-files/example-after.elf -- test-elf-files/example-before.elf\n```\n```\n    FILE SIZE        VM SIZE    \n --------------  -------------- \n   +14%  +221Ki  [ = ]       0    .debug_info\n   +12% +52.4Ki  [ = ]       0    .debug_line\n   +13% +46.0Ki  [ = ]       0    .debug_loc\n   +13% +24.5Ki  [ = ]       0    .debug_abbrev\n   +18% +20.8Ki   +18% +20.8Ki    .text\n  +9.8% +16.4Ki  [ = ]       0    .debug_str\n   +17% +11.2Ki  [ = ]       0    .symtab\n   +21% +10.9Ki  [ = ]       0    .strtab\n   +11% +7.89Ki  [ = ]       0    .debug_ranges\n  +9.5% +5.57Ki  [ = ]       0    .debug_frame\n  +9.3% +1.71Ki  [ = ]       0    .debug_aranges\n  [ = ]       0  +9.6%    +792    .bss\n -24.4%    -120 -26.5%    -120    .data\n  [ = ]       0  -0.7%    -792    .heap\n -15.2% -20.7Ki  [ = ]       0    [Unmapped]\n   +12%  +397Ki  +5.6% +20.7Ki    TOTAL\n```\n\nThe other [`ghcr.io/carlosperate/bloaty-action`](docker-action/) Docker image\nis built on top of the base `bloaty` image to run with GitHub Actions, and\nincludes a custom script adding GitHub Actions specific features.\n\n## Additional Action Examples\n\nTo better understand what arguments to use with Bloaty, the documentation is\nnot very long and a recommended read:\n[google/bloaty/doc/using.md](https://github.com/google/bloaty/blob/52948c107c8f81045e7f9223ec02706b19cfa882/doc/using.md)\n\nPersonally, I like to use the following flags to analyse where the data/memory is going:\n```\nbloaty -d compileunits,symbols --domain=vm \u003cpath_to_file\u003e\n```\n\nTo add a the Bloaty output to the\n[GitHub Actions Job Summary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)\nsimply set the `output-to-summary` input to `true`:\n\n\u003cimg width=\"30%\" src=\"https://user-images.githubusercontent.com/4189262/216423832-cfad5b15-e206-47fb-a653-45a256f9f267.png\" align=\"left\" alt=\"GH Action Run summary screenshot\"\u003e\n\n```yaml\n- name: Run Bloaty \u0026 add output to the run summary\n  uses: carlosperate/bloaty-action@v1\n  with:\n    bloaty-args: -d compileunits,symbols test-elf-files/example-before.elf\n    output-to-summary: true\n    summary-title: \"Size profile of `example-before.elf` largest components\"\n```\n\n\u003cbr clear=\"left\"/\u003e\n\nTo create a PR comment, add an `id` to the `carlosperate/bloaty-action` step,\nand then use its output with the the\n[`actions/github-script`](https://github.com/actions/github-script/) action to\npost a markdown comment to the PR:\n\n\u003cimg width=\"30%\" src=\"https://user-images.githubusercontent.com/4189262/216636388-9fe86aa8-4d53-47bb-be99-415fec07bc88.png\" align=\"left\" alt=\"PR comment screenshot\"\u003e\n\n```yaml\n- name: Run Bloaty McBloatface on an ELF file\n  uses: carlosperate/bloaty-action@v1\n  id: bloaty-step\n  with:\n    bloaty-args: test-elf-files/example-before.elf\n- name: Add a PR comment with the bloaty output\n  uses: actions/github-script@v6\n  with:\n    script: |\n      github.rest.issues.createComment({\n        issue_number: context.issue.number,\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        body: '## Bloaty output\\n```\\n${{ steps.bloaty-step.outputs.bloaty-output-encoded }}```\\n'\n      })\n```\n\nThe following example shows how to build your project before and after the\nPR commits, and how to post the size diff as a PR comment:\n\n```yml\nsteps:\n  - name: Check out the repo with the full git history\n    uses: actions/checkout@v3\n    with:\n      fetch-depth: '0'\n  - name: Build your project (example for a standard Makefile, change as required)\n    run: make\n  - name: Save the built ELF/Mach-O/PE/COFF file to a different directory where it doesn't get cleaned out\n    run: mv \u003cpath_to_your_elf\u003e ../original.elf\n  - name: If it's a PR checkout the base commit\n    if: ${{ github.event.pull_request }}\n    run: git checkout ${{ github.event.pull_request.base.sha }}\n  - name: Clean the build and rebuild with the base commit\n    if: ${{ github.event.pull_request }}\n    run: |\n      make clean\n      make\n  - name: Run Bloaty to compare both output files\n    if: ${{ github.event.pull_request }}\n    id: bloaty-comparison\n    uses: carlosperate/bloaty-action@v1\n    with:\n      bloaty-args: ../original.elf -- \u003cpath_to_the_base_commit_elf\u003e\n      output-to-summary: true\n  - name: Add a PR comment with the bloaty diff\n    if: ${{ github.event.pull_request }}\n    continue-on-error: true\n    uses: actions/github-script@v6\n    with:\n      script: |\n        github.rest.issues.createComment({\n          issue_number: context.issue.number,\n          owner: context.repo.owner,\n          repo: context.repo.repo,\n          body: '## PR build size diff\\n```\\n${{ steps.bloaty-comparison.outputs.bloaty-output-encoded }}```\\n'\n        })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosperate%2Fbloaty-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosperate%2Fbloaty-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosperate%2Fbloaty-action/lists"}