tokusumi / markdown-embed-code

Action to synchronize "any" code in markdown with an external file. No more managing code as plain text.
MIT License
29 stars 14 forks source link

Are non-README files supported? #12

Closed Becheler closed 2 years ago

Becheler commented 2 years ago

I am trying (and failing!) to use this action to embed unit test code in some tutorials.

Here is my .github/workflows/github-pages.yml :

name: Build and deploy Jekyll site to GitHub Pages

on:
  push:
    branches:
      - develop # or main after October 2020
  schedule:
    - cron: "0 0 * * *" # build daily at midnight

jobs:
  github-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        #persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
        #fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
        #ref: refs/heads/${{ github.head_ref }}

      - name: Download Quetzal-CoalTL
        run: git clone https://github.com/Becheler/quetzal-CoalTL.git

      - uses: tokusumi/markdown-embed-code@main
        with:
          markdown: "/my_collections/_quetzal-coaltl-tutorials/a-random-walker.md"
          token: ${{ secrets.GITHUB_TOKEN }}
          message: "synchronizing tutorial"

      - uses: helaili/jekyll-action@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

The file supposed to be embedded is:

\```cpp:quetzal-CoalTL/test/tutorials_test/tuto_1.cpp
// file main.cpp
\```

But I get this error message:

Run tokusumi/markdown-embed-code@main
  with:
    markdown: /my_collections/_quetzal-coaltl-tutorials/a-random-walker.md
    token: ***
    message: synchronizing tutorial
    no_change: No changes on README!
    silent: false
/usr/bin/docker run --name a68250bbc294923d9454dab0a79e91ec99669_ccf440 --label 6a6825 --workdir /github/workspace --rm -e INPUT_MARKDOWN -e INPUT_TOKEN -e INPUT_MESSAGE -e INPUT_NO_CHANGE -e INPUT_OUTPUT -e INPUT_SILENT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/Becheler.github.io/Becheler.github.io":"/github/workspace" 6a6825:0bbc294923d9454dab0a79e91ec99669

Despite numerous try and fail, I could not get it working. Any suggestion?

tokusumi commented 2 years ago

Would you try the follwings?:

Becheler commented 2 years ago

Hi tokusumi! Thank you for your answer! However in the meantime I ended up using https://github.com/dineshsonachalam/markdown-autodocs , that solved my problem! Have a wonderful year 2022!