Giter Club home page Giter Club logo

peter-evans_link-checker's Introduction

Link Checker

GitHub Marketplace

โš ๏ธ This action is deprecated. Please consider using lychee-action.

A GitHub action for link checking repository Markdown and HTML files.

When used in conjunction with Create Issue From File, issues will be created when Link Checker finds connectivity problems with links.

Usage

Using with the default settings will check all markdown and HTML files in your repository.

    - name: Link Checker
      uses: peter-evans/link-checker@v1

Link Checker uses Liche. Liche arguments can be passed to the action via the args parameter. If not set, the default -v -r * will be used.

    - name: Link Checker
      uses: peter-evans/link-checker@v1
      with:
        args: -v -r *

See Liche's documentation for further argument details.

Optional environment variables

If Link Checker finds connectivity problems with links the action will output a markdown file containing the error report. The default path is link-checker/out.md. The path and filename may be overridden with the following variables.

  • LINKCHECKER_OUTPUT_DIR - The output directory the markdown error report
  • LINKCHECKER_OUTPUT_FILENAME - The error report filename

Receiving issues containing the error report

Below is an example of using this action in conjunction with Create Issue From File. The workflow executes on a schedule every month. Issues will be created when Link Checker finds connectivity problems with links.

on:
  schedule:
  - cron: '0 0 1 * *'
name: Check markdown links
jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Link Checker
        uses: peter-evans/link-checker@v1
      - name: Create Issue From File
        uses: peter-evans/create-issue-from-file@v2
        with:
          title: Link Checker Report
          content-filepath: ./link-checker/out.md
          labels: report, automated issue

Issue sample

This link is intentionally non-existent. The workflow in this repository generated this sample issue.

Creating a failing check for link errors

To create a failing check when there are link errors you can use the exit_code output from the action as follows.

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

License

MIT

peter-evans_link-checker's People

Contributors

gecko655 avatar peter-evans avatar user340 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.