Giter VIP home page Giter VIP logo

Comments (6)

mre avatar mre commented on July 17, 2024 1

Thanks for the feedback. 👍 Since this seems to be a common footgun, I might still change the entrypoint to also check args for the output parameter, as described above. #201

from lychee-action.

mre avatar mre commented on July 17, 2024

Thanks for the report @jasongitmail!

We only wrote the output to file in case of error (exit code == 0).

I don't know why we did that. It's a remnant of the original (now deprecated) action code from link-checker:
https://github.com/peter-evans/link-checker/blame/ce2cdf3d3f679dca05554c43f493821b878e1b4d/entrypoint.sh
There probably was a good reason to do this in the old action, but for us, it's quite limiting, and so I removed that condition again.

Instead, we'll always write an output file now. Apologies for the inconvenience.
You can test it by using lycheeverse/lychee-action@master and if all goes well, please report back. I'll release a new version then. ✌️

from lychee-action.

jasongitmail avatar jasongitmail commented on July 17, 2024

Unfortunately, there seems to still be something awry.

I tested uses: lycheeverse/lychee-action@master

Then I also ran ls -la for a number of directories after running lychee-action to try to find the file, in case it saved somewhere unexpected, but it wasn't anywhere to be found. I also tried a filename that does not have a directory in the path, since my actual path contains a dir, in case that made a difference, but same result. I'm using the same command that otherwise works with lychee directly as the args for the action.

from lychee-action.

mre avatar mre commented on July 17, 2024

Ah, so you overwrite --output, in your args right?
So you have something like

- name: Link Checker
  uses: lycheeverse/lychee-action@master
  with:
    args: --output foo.txt ...

If so, this is a bit tricky, because it is currently not used.
Instead, the recommended way is to set the additional output argument for the action and not set it in args:

- name: Link Checker
  uses: lycheeverse/lychee-action@master
  with:
    # Check all markdown and html files in repo (default)
    args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
    # Use json as output format (instead of markdown)
    format: json
    # Use different output file path <-- That's what you're looking for
    output: /tmp/foo.json

This puts the output into /tmp/foo.json. The default is lychee/out.md, relative to the working directory of the action.

Can you try that?

If it's not possible, I can change it such that it uses --output from the args if it is set. This should avoid the confusion for users. We already do something similar for --format:

ARGS="${INPUT_ARGS}"
FORMAT=""
# Backwards compatibility:
# If `format` occurs in args, ignore the value from `INPUT_FORMAT`
[[ "$ARGS" =~ "--format " ]] || FORMAT="--format ${INPUT_FORMAT}"

But first, I'd like to learn if setting output: /tmp/foo.json works for you.

If I misunderstood, can you paste your workflow here?

from lychee-action.

jasongitmail avatar jasongitmail commented on July 17, 2024

Oh sorry, yeah let me try that. I was using the args version

from lychee-action.

jasongitmail avatar jasongitmail commented on July 17, 2024

Working with that syntax! Thanks for the fix!

from lychee-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.