Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use HTML Table #27

Open
gthomson31 opened this issue Oct 12, 2022 · 1 comment
Open

Unable to use HTML Table #27

gthomson31 opened this issue Oct 12, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gthomson31
Copy link

gthomson31 commented Oct 12, 2022

Currently trying to setup a JSON to HTML table within a subfolder of the repo.
It can successfully find the code file and map this as expected but is throwing up this error when mapping the table

[2022-10-12T15:01:08.771] [INFO] default - Converted JSON to HTML table. Then auto-documented HTML table in ./modules/cloud/deploy_pipeline/README.md
node:fs:599
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/usr/src/app/json-that-i-want-in-readme-as-a-table.json'
    at Object.openSync (node:fs:599:3)
    at Module.readFileSync (node:fs:467:35)
    at Object.convertJsonToHtmlTable [as JSON_TO_HTML_TABLE] (file:///usr/local/lib/node_modules/markdown-autodocs/utils/app.js:32:35)
    at updateContents (/usr/local/lib/node_modules/markdown-autodocs/node_modules/markdown-magic/lib/updateContents.js:24:56)
    at processFile (/usr/local/lib/node_modules/markdown-autodocs/node_modules/markdown-magic/lib/processFile.js:102:32)
    at /usr/local/lib/node_modules/markdown-autodocs/node_modules/markdown-magic/index.js:33:21
    at Array.map (<anonymous>)
    at markdownMagic (/usr/local/lib/node_modules/markdown-autodocs/node_modules/markdown-magic/index.js:32:22)
    at app (file:///usr/local/lib/node_modules/markdown-autodocs/utils/app.js:[86](https://github.com/snowplow-devops/github-action-modules/actions/runs/3235723994/jobs/5300549037#step:3:89):9)
    at main (file:///usr/local/lib/node_modules/markdown-autodocs/index.js:35:31) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/usr/src/app/json-that-i-want-in-readme-as-a-table.json'
}`

Workflow File

name: Update Code Blocks
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
jobs:
  auto-update-readme:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Markdown AutoDocs
        uses: dineshsonachalam/markdown-autodocs@v1.0.7
        with:
          output_file_paths: '[./README.md,./modules/cloud/deploy_pipeline/README.md]'

json file path

modules/cloud/deploy_pipeline/json-that-i-want-in-readme-as-a-table.json

README mapping

### Action Inputs
<!-- MARKDOWN-AUTO-DOCS:START (JSON_TO_HTML_TABLE:src=./json-that-i-want-in-readme-as-a-table.json) -->
<!-- MARKDOWN-AUTO-DOCS:END -->

Any help would be greatly appreciated! - also this is a great project

@gthomson31
Copy link
Author

Ended up being a strange bug where it would only allow me to use JSON files if it was located at the top level directory.
Putting them in a folder at the root of the repo and then calling them in resolved the issue

Will leave open for now and try check through the code

❯ tree docs/
docs/
├── deploy_pipeline_inputs.json
├── destroy_pipeline_inputs.json
├── example_module_clone.yaml
├── last_updated.txt
├── manipulate.py
└── slack_inputs.json
<!-- MARKDOWN-AUTO-DOCS:START (JSON_TO_HTML_TABLE:src=../docs/destroy_pipeline_inputs.json) -->
<!-- MARKDOWN-AUTO-DOCS:END -->

@dineshsonachalam dineshsonachalam added the bug Something isn't working label Nov 13, 2022
@dineshsonachalam dineshsonachalam self-assigned this Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants