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