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

Propagate lychee exit code #145

Merged
merged 2 commits into from Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 15 additions & 10 deletions action.yml
Expand Up @@ -2,50 +2,55 @@ name: "Lychee Broken Link Checker"
description: "Quickly check links in Markdown, HTML, and text files"
inputs:
args:
description: "lychee arguments"
description: "Lychee arguments (https://github.com/lycheeverse/lychee#commandline-parameters)"
default: "--verbose --no-progress './**/*.md' './**/*.html'"
required: false
format:
description: "summary output format (e.g. json)"
description: "Summary output format (e.g. json)"
default: "markdown"
required: false
output:
description: "summary output file path"
description: "Summary output file path"
default: "lychee/out.md"
required: false
fail:
description: "fail entire pipeline on error (i.e. when lychee exit code is not 0)"
description: "Fail entire pipeline on error (i.e. when lychee exit code is not 0)"
default: false
required: false
jobSummary:
description: "write Github job summary at the end of the job (written on Markdown output only)"
description: "Write Github job summary at the end of the job (written on Markdown output only)"
default: true
required: false
lycheeVersion:
description: "use custom version of lychee link checker"
description: "Use custom version of lychee link checker"
default: 0.10.0
required: false
outputs:
exit_code:
description: "The exit code returned from Lychee"
value: ${{ steps.lychee.outputs.exit_code }}
runs:
using: "composite"
steps:
- name: install lychee
- name: Install lychee
run: |
curl -LO 'https://github.com/lycheeverse/lychee/releases/download/v${{ inputs.LYCHEEVERSION }}/lychee-v${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz'
tar -xvzf lychee-v${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz
chmod 755 lychee
mv lychee /usr/local/bin/lychee
shell: bash
- run: ${{ github.action_path }}/entrypoint.sh
- name: Run lychee
run: ${{ github.action_path }}/entrypoint.sh
id: lychee
Copy link
Member Author

Choose a reason for hiding this comment

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

Does this id have to be unique across the entire Github action pipeline? If so, rename to lychee-cli-run to avoid conflicts.

Choose a reason for hiding this comment

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

The composite action docs aren't that helpful at clarifying that. I assume it only needs to be unique within this action.yml scope.

So I doubt that will be a concern. Easy enough to verify after it's merged?

env:
#https://github.com/actions/runner/issues/665
# https://github.com/actions/runner/issues/665
INPUT_GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
INPUT_ARGS: ${{ inputs.ARGS }}
INPUT_FORMAT: ${{ inputs.FORMAT }}
INPUT_OUTPUT: ${{ inputs.OUTPUT }}
INPUT_FAIL: ${{ inputs.FAIL }}
INPUT_JOBSUMMARY: ${{ inputs.JOBSUMMARY }}
shell: bash

branding:
icon: "external-link"
color: "purple"