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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

psobolewskiPhD
Copy link

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

@@ -35,6 +35,7 @@ jobs:
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
continue-on-error: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
continue-on-error: true
with:
fail: false

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