Skip to content

[Bug]: Table format check does not detect formatting changes #253

@WilliamBerryiii

Description

@WilliamBerryiii

Component

Scripts

Bug Description

The table-format.yml workflow does not actually detect when tables need formatting. It runs npm run format:tables and only fails if the command itself errors, but markdown-table-formatter exits successfully even when it modifies files.

Current logic:

npm run format:tables > table-format-output.txt 2>&1 || echo "TABLE_FORMAT_FAILED=true" >> $GITHUB_ENV

This only sets TABLE_FORMAT_FAILED=true if markdown-table-formatter exits with a non-zero code. However, the tool formats files in place and exits 0 regardless of whether changes were made.

Several files in the repository have tables that are not properly formatted and pass through PR validation without triggering a failure:

  • GOVERNANCE.md
  • docs/contributing/ROADMAP.md
  • docs/getting-started/first-workflow.md

Expected Behavior

The workflow should:

  1. Run npm run format:tables
  2. Check if any files were modified using git diff --name-only
  3. Fail the check if modifications were detected

Steps to Reproduce

  1. Modify a table in any markdown file to be misaligned
  2. Commit and push to a PR branch
  3. Observe that table-format check passes

Additional Context

Proposed fix for .github/workflows/table-format.yml:

- name: Check table formatting
  id: table-format
  run: |
    npm run format:tables > table-format-output.txt 2>&1
    cat table-format-output.txt
    if [ -n "$(git diff --name-only)" ]; then
      echo "TABLE_FORMAT_FAILED=true" >> $GITHUB_ENV
      echo "Files with formatting issues:"
      git diff --name-only
    fi
  continue-on-error: true

Workaround: Run npm run format:tables locally before committing.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions