Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 2 commits into from
Nov 19, 2024

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).

README.md Outdated Show resolved Hide resolved
@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.

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

Successfully merging this pull request may close these issues.

3 participants