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

Failing check when I want an informative check #37

Closed
kaihendry opened this issue Jul 3, 2021 · 10 comments
Closed

Failing check when I want an informative check #37

kaihendry opened this issue Jul 3, 2021 · 10 comments

Comments

@kaihendry
Copy link

I use this action simply:

name: Links

on:
  workflow_dispatch:
  push:

jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Link Checker
        uses: lycheeverse/lychee-action@v1
        with:
          args: --verbose --no-progress **/*.mdwn

upon https://github.com/kaihendry/geekout.org.uk/blob/07328724ab98e8fc91105255654b399baa27fe58/.github/workflows/links.yaml

However it has two surprisingly issues:

  • it causes a failure, I assumed reading the documentation I needed run: exit ${{ steps.lychee.outputs.exit_code }} to actually cause a failure
  • doesn't appear to summarize the failing links in a sane way

What am I doing wrong please?

@mre
Copy link
Member

mre commented Jul 8, 2021

Thanks for trying lychee. 😊

About your questions:

kaihendry added a commit to kaihendry/geekout.org.uk that referenced this issue Jul 10, 2021
@kaihendry
Copy link
Author

Thanks, I applied your change https://github.com/kaihendry/geekout.org.uk/runs/3034419141

Is there a way just to highlight the failing links? I.e. do not show the successful / working links

image

This would help me prioritize what I should fix first.

And last but not least, is there a sane way to "fix" broken links? Propose to rewrite them to http://web.archive.org/ or https://archive.is/ if the URL is archived upon them?

Thank you again!

@mre
Copy link
Member

mre commented Jul 12, 2021

Is there a way just to highlight the failing links?

Sure, just remove --verbose.

And last but not least, is there a sane way to "fix" broken links? Propose to rewrite them to http://web.archive.org/ or https://archive.is/ if the URL is archived upon them?

I thought this was proposed before, but I can't find the issue anymore. 🤔 It's a great idea, though. We could add a --fix flag that proposes those changes. Could you create a new issue over at https://github.com/lycheeverse/lychee to track that?

@mre
Copy link
Member

mre commented Jul 13, 2021

Thanks for creating that ticket @kaihendry.

@kaihendry
Copy link
Author

Hi, despite adding continue-on-error: true, I still see:

[Links/linkChecker]   ❌  Failure - Link Checker
Error: exit with `FAILURE`: 2

Is that expected? I rather just have it run and not look like some sort of CI fail, if that makes any sense.

Thank you!

@mre
Copy link
Member

mre commented Jul 14, 2021

I think that's expected, yeah. continue-on-error: true just means that an error will not cancel the entire pipeline. However individual steps can still fail.

@mre
Copy link
Member

mre commented Jul 14, 2021

I haven't tested it, but perhaps you could overwrite the lychee exit code?

- name: Link Checker
  uses: lycheeverse/lychee-action@v1
  with:
    args: --verbose --no-progress **/*.mdwn || exit 0
    issue: false

@kaihendry
Copy link
Author

Looks like the pipe gets quoted.... hmm https://github.com/kaihendry/geekout.org.uk/runs/3067535049?check_suite_focus=true

@mre
Copy link
Member

mre commented Jul 14, 2021

We could add an exit field to the action like so:

- name: Link Checker
  uses: lycheeverse/lychee-action@v1
  with:
    args: --verbose --no-progress **/*.mdwn
    issue: false
    exit: 0

Alternatively we could add a flag to lychee:

- name: Link Checker
  uses: lycheeverse/lychee-action@v1
  with:
    args: --verbose --no-progress **/*.mdwn --exit 0
    issue: false

To be honest, these options feel like hacks to me. I wonder if that's a common enough use-case to add that feature. 😕

@kaihendry
Copy link
Author

kaihendry commented Jul 14, 2021

continue-on-error: true in the step works actually, thanks for you help !!

https://github.com/kaihendry/geekout.org.uk/actions/runs/1030628076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants