Skip to content

Update README.md to include continue-on-error: true in action#267

Merged
mre merged 2 commits intolycheeverse:masterfrom
psobolewskiPhD:patch-1
Nov 19, 2024
Merged

Update README.md to include continue-on-error: true in action#267
mre merged 2 commits intolycheeverse:masterfrom
psobolewskiPhD:patch-1

Conversation

@psobolewskiPhD
Copy link
Contributor

I had to add

continue-on-error: true

in order for the next step to fire when there were broken links -- regardless of the if:
I tested with adding a Debug echo step after the lychee step.

- name: Debug Exit Code
        run: | 
          echo "Lychee exit code: ${{ steps.lychee.outputs.exit_code }}"

And this was skipped.

@mre
Copy link
Member

mre commented Nov 8, 2024

Yeah, I think that makes sense. @YDX-2147483647, right?

@YDX-2147483647
Copy link
Contributor

YDX-2147483647 commented Nov 9, 2024

I agree that the example in the README does not work, but I suggest adding fail: false instead.

- name: Link Checker
id: lychee
uses: ./ # Uses an action in the root directory
with:
args: --user-agent "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" --verbose --exclude spinroot.com --no-progress './**/*.md' './**/*.html' './**/*.rst'
fail: true

    - name: Link Checker
      id: lychee
      uses: lycheeverse/lychee-action@v2
+     with:
+         fail: false

If lychee is properly configured, fail: false and continue-on-error: true behave identically. But if lychee somehow cannot find any link, then fail: false fails the CI (due to failIfEmpty), but continue-on-error: true creates an issue with zero broken links.


I actually use fail: ${{ github.event_name == 'pull_request' }}. It fails on pull request, but create an issue otherwise (e.g., in main).

@mre mre merged commit 4aa18b6 into lycheeverse:master Nov 19, 2024
@mre
Copy link
Member

mre commented Nov 19, 2024

Thanks for your contribution @psobolewskiPhD.

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

Successfully merging this pull request may close these issues.

3 participants