Skip to content

Commit

Permalink
feat: format as markdown (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra authored Nov 12, 2024
1 parent f095e14 commit 5e3526c
Show file tree
Hide file tree
Showing 14 changed files with 9,908 additions and 1,764 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,29 @@ jobs:
run: npm test -- --run

- name: test action
id: gas
uses: ./
with:
ROOT_REPORT_PATH: "mocks/gas.backup.json"
REPORT_PATH: "mocks/gas.json"

- name: Prepare comment
run: |
printf ":fuelpump: **Gas report**\n\n" > /tmp/template.md
printf '%s' "${{ steps.gas.outputs.gas-report }}" >> /tmp/template.md
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "Gas report"

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: /tmp/template.md
edit-mode: replace
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ inputs:
ROOT_REPORT_PATH:
description: "The path to the gas report to diff against. If empty it will not diff, but just pretty print the report."
required: false

REPORT_PATH:
description: "The path to the gas report."
required: true
ignoreUnchanged:
description: "If true, the diff will ignore unchanged items."
required: false
default: "false"

outputs:
gas-report:
Expand Down
Loading

0 comments on commit 5e3526c

Please sign in to comment.