Skip to content

Storage check is generating a table rather than json outputย #180

@0x1NotMe

Description

@0x1NotMe

๐Ÿ“ Issue Description

First, thank you for creating this valuable plugin! I've been attempting to integrate it into my workflow, but I'm encountering an issue where the --json flag is being ignored in the GitHub Actions environment.

๐Ÿ› Bug Details

When the action runs forge inspect {contract} storage-layout --json, it's receiving a formatted table output with borders (starting with โ•ญ) instead of JSON. This causes the JSON parser to fail with:

Error: SyntaxError: Unexpected token 'โ•ญ', "
  โ•ญ---------"... is not valid JSON

๐Ÿ’ป Environment

  • GitHub Actions runner
  • Using version v3.8 of the foundry-storage-check action
  • The contract being checked is a Solidity contract with complex inheritance

๐Ÿ“‹ Error Output

Generate storage layout of contract "src/shmonad/ShMONAD.sol:ShMonad" using foundry forge
  Start forge process
  Parse generated layout
  Error while parsing storage layout: 
  โ•ญ---------------------+-------------------------------------------------------------+------+--------+-------+---------------------------------โ•ฎ
  | Name                | Type                                                        | Slot | Offset | Bytes | Contract                        |
  +=============================================================================================================================================+
  | s_policyCount       | uint64                                                      | 0    | 0      | 8     | src/shmonad/ShMONAD.sol:ShMonad |
  ...
  โ•ฐ---------------------+-------------------------------------------------------------+------+--------+-------+---------------------------------โ•ฏ
  
  Error: SyntaxError: Unexpected token 'โ•ญ', "
  โ•ญ---------"... is not valid JSON

๐Ÿ” Investigation

I've confirmed that:

  1. The --json flag is included in the command in the source code
  2. The same command works correctly in my local environment
  3. The issue appears specific to the GitHub Actions environment
forge Version: 1.0.0-nightly

Please let me know if you need any additional information to help diagnose and fix this issue.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions