peter-evans / link-checker

A GitHub action for link checking repository Markdown and HTML files
MIT License
49 stars 11 forks source link

Trouble getting exit_code to work #21

Closed spier closed 4 years ago

spier commented 4 years ago

Hi, and thanks for building this GitHub Action for link checking!

I configured the Action exactly as documented here: https://github.com/marketplace/actions/link-checker#creating-a-failing-check-for-link-errors

on: push
jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Link Checker
      id: lc
      uses: peter-evans/link-checker@v1
      with:
        args: -v -r *
    - name: Fail if there were link errors
       run: exit ${{ steps.lc.outputs.exit_code }}

When this Action is run, I get the following error message:

Check failure on line 17 in .github/workflows/main.yml

GitHub Actions / .github/workflows/main.yml

Parse error You have an error in your yaml syntax on line 17

Line 17 is the last one in the example above i.e. run: exit ${{ steps.lc.outputs.exit_code }}

Any idea what might be wrong here?

peter-evans commented 4 years ago

Hi @spier

I made a small mistake on that line in the README. I've corrected it now. Please try the following.

on: push
jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Link Checker
      id: lc
      uses: peter-evans/link-checker@v1
      with:
        args: -v -r *
    - name: Fail if there were link errors
      run: exit ${{ steps.lc.outputs.exit_code }}
spier commented 4 years ago

Hah, that did the trick. Thanks for the quick help @peter-evans!

So was it really just the extra space in front of the run:?

Have a great weekend, and thanks again!