From a95c49f3cebdb3ec4a8ca9bf749f8fbb08123cb1 Mon Sep 17 00:00:00 2001 From: rzzf Date: Tue, 16 Jun 2026 13:41:21 +0800 Subject: [PATCH 1/2] docs: update README to include `comment-body` output --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2fdaea8..02c474c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,18 @@ jobs: > **Note:** Due to GitHub's permission model, this action cannot safely create comments when it is triggered by a PR from a fork. It will, however, still generate the size comparison and print the comment it would've posted to the stdout of the action, allowing manual checking and you can copy/paste it into a comment if you wish. +The comment that `compressed-size-action` posts to pull requests is also exposed as the `comment-body` output. This can be used by later workflow steps to archive the report, pass it to another job, or post the comment from a separate workflow with the permissions you need: + +```yaml +- id: compressed-size + uses: preactjs/compressed-size-action@v2 + +- name: Save compressed size comment + env: + COMMENT_BODY: ${{ steps.compressed-size.outputs.comment-body }} + run: printf '%s\n' "$COMMENT_BODY" > compressed-size-comment.md +``` + ### Customizing the Installation By default, `compressed-size-action` will install dependencies according to which lockfiles are present, if any. However, if you need to run a different installation command, you can pass a custom script to do so. For example, to use `npm ci` with the `--workspace` option: From 2d82566595ffd502c19721e09b9f26e51101eccb Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:06:43 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 02c474c..d280e12 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ jobs: > **Note:** Due to GitHub's permission model, this action cannot safely create comments when it is triggered by a PR from a fork. It will, however, still generate the size comparison and print the comment it would've posted to the stdout of the action, allowing manual checking and you can copy/paste it into a comment if you wish. -The comment that `compressed-size-action` posts to pull requests is also exposed as the `comment-body` output. This can be used by later workflow steps to archive the report, pass it to another job, or post the comment from a separate workflow with the permissions you need: +The markdown comment that `compressed-size-action` posts to pull requests is also exposed as the `comment-body` output. This can be used by later workflow steps to archive the report, pass it to another job, or post the comment from a separate workflow with the permissions you need: ```yaml - id: compressed-size