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

Check Markdown Files Recursively #10

Closed
joesan opened this issue Feb 9, 2021 · 6 comments
Closed

Check Markdown Files Recursively #10

joesan opened this issue Feb 9, 2021 · 6 comments
Labels
question Further information is requested waiting-for-feedback

Comments

@joesan
Copy link

joesan commented Feb 9, 2021

How do I pass a command to the argument with which I can make a recursive check? For example., my markdown files for my Github pages ate located in a docs folder which in turn contains many sub folders. In these sub folders I have several markdown files and I want to be able to test in all these markdown files.

Additionally I also have in my markdown files some links that use the a href tags, the reason being that I want those links to open in a new tab. Could this action check for a hrefs as well or will it only look for markdown style links with the ?

@joesan
Copy link
Author

joesan commented Feb 10, 2021

This is what I have as an action:

jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Link Checker
        uses: lycheeverse/lychee-action@v1
        with:
          args: -v 'docs/**/*.markdown'
      - name: Create Issue From File
        uses: peter-evans/create-issue-from-file@v2
        with:
          title: Link Checker Report
          content-filepath: ./lychee/out.md
          labels: report, automated issue

Where the docs folder is to be found at the root of my project and contains sub folders inside which I have the markdown files.

Here is what I see as output:

/usr/bin/docker run --name b37505bb927e4ef49249907c73c73779_c4bfb8 --label 442333 --workdir /github/workspace --rm -e INPUT_ARGS -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_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_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_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/navo-docs/navo-docs":"/github/workspace" 442333:b37505bb927e4ef49249907c73c73779 -v '../../docs/**/*.markdown'
+ LYCHEE_OUT=lychee/out.md
+ LYCHEE_TMP=/tmp/lychee/out.md
++ dirname /tmp/lychee/out.md
+ mkdir -p /tmp/lychee
+ lychee -v ''\''../../docs/**/*.markdown'\''' --output /tmp/lychee/out.md

📝 Summary
-------------------
🔍 Total: 0
✅ Successful: 0
⏳ Timeouts: 0
🔀 Redirected: 0
👻 Excluded: 0
🚫 Errors: 0

+ exit_code=0
📝 Summary
+ '[' 0 -ne 0 ']'
+ cat /tmp/lychee/out.md
+ echo ::set-output name=exit_code::0
-------------------
🔍 Total: 0
✅ Successful: 0
⏳ Timeouts: 0
🔀 Redirected: 0
👻 Excluded: 0
🚫 Errors: 0

@mre
Copy link
Member

mre commented Feb 11, 2021

Something is messing up those parameters:

lychee -v ''\''../../docs/**/*.markdown'\''' --output /tmp/lychee/out.md

Without the escaping it works for me, e.g.

lychee -v 'docs/**/*.markdown'

(Saw that you changed the path from ../../docs to docs in navo-org/navo-docs@cd4b6a6)

@joesan
Copy link
Author

joesan commented Feb 11, 2021

So is that a bug that could be fixed?

@mre
Copy link
Member

mre commented Feb 11, 2021

Not sure if it's a bug in lychee. AFAIK YAML doesn't do any escaping or? Github actions and the shell shouldn't either, but the escaping must come from... somewhere (?).

@mre
Copy link
Member

mre commented Feb 11, 2021

Apparently wrapping the arg in double quotes works:

args: -v "docs/**/*.markdown"

See https://github.com/mre/navo-docs/runs/1881501120?check_suite_focus=true

@mre mre added question Further information is requested waiting-for-feedback labels Feb 11, 2021
@joesan
Copy link
Author

joesan commented Feb 11, 2021

Cool! I should have tried those possibilities with double quotes in the first place! Thanks anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested waiting-for-feedback
Projects
None yet
Development

No branches or pull requests

2 participants