All Projects → lycheeverse → lychee-action

lycheeverse / lychee-action

Licence: other
Github action to check for broken links in Markdown, HTML, and text files using lychee, a fast link checker written in Rust.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to lychee-action

actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (-24.72%)
Mutual labels:  continuous-integration, action, github-actions
hugo-action
Commands to help with building Hugo based static sites
Stars: ✭ 65 (-26.97%)
Mutual labels:  action, github-actions
link-snitch
GitHub Action to scan your site for broken links so you can fix them 🔗
Stars: ✭ 50 (-43.82%)
Mutual labels:  continuous-integration, github-actions
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+57.3%)
Mutual labels:  action, github-actions
hasura-action
GitHub Action wrapping the Hasura CLI
Stars: ✭ 39 (-56.18%)
Mutual labels:  continuous-integration, github-actions
prettier
🔨 Native, blazingly-fast Prettier CLI on Github Actions
Stars: ✭ 19 (-78.65%)
Mutual labels:  continuous-integration, github-actions
setup-scheme
Github Actions CI / CD setup for Scheme
Stars: ✭ 13 (-85.39%)
Mutual labels:  continuous-integration, github-actions
action-ansible-playbook
⚙️ A GitHub Action for running Ansible playbooks
Stars: ✭ 133 (+49.44%)
Mutual labels:  action, github-actions
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (-30.34%)
Mutual labels:  action, github-actions
arduino-lint-action
GitHub Actions action to check Arduino projects for problems
Stars: ✭ 20 (-77.53%)
Mutual labels:  continuous-integration, github-actions
colab-badge-action
GitHub Action that generates "Open In Colab" Badges for you
Stars: ✭ 15 (-83.15%)
Mutual labels:  action, github-actions
jest-github-action
Jest action adding checks with annotations to your pull requests and coverage table as comments
Stars: ✭ 134 (+50.56%)
Mutual labels:  action, github-actions
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-86.52%)
Mutual labels:  action, github-actions
noise-php
A starter-kit for your PHP project.
Stars: ✭ 52 (-41.57%)
Mutual labels:  continuous-integration, github-actions
rubocop-linter-action
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Stars: ✭ 86 (-3.37%)
Mutual labels:  action, github-actions
xray-action
... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.
Stars: ✭ 16 (-82.02%)
Mutual labels:  continuous-integration, github-actions
setup-clang
GitHub action to set up Clang & LLVM
Stars: ✭ 28 (-68.54%)
Mutual labels:  action, github-actions
clojure-dependency-update-action
A simple GitHub Actions job to create Pull Requests for outdated dependencies in clojure projects
Stars: ✭ 37 (-58.43%)
Mutual labels:  action, github-actions
setup-unity
GitHub Action to download and install Unity on Ubuntu, macOS or Windows. Based on Unity Hub
Stars: ✭ 26 (-70.79%)
Mutual labels:  continuous-integration, github-actions
bump-everywhere
🚀 Automate versioning, changelog creation, README updates and GitHub releases using GitHub Actions,npm, docker or bash.
Stars: ✭ 24 (-73.03%)
Mutual labels:  continuous-integration, github-actions

lychee link checking action

GitHub Marketplace Check Links

Quickly check links in Markdown, HTML, and text files using lychee.

When used in conjunction with Create Issue From File, issues will be created when the action finds link problems.

Usage

Here is a full example of a GitHub workflow file:

It will check all repository links once per day and create an issue in case of errors. Save this under .github/workflows/links.yml:

name: Links

on:
  repository_dispatch:
  workflow_dispatch:
  schedule:
    - cron: "00 18 * * *"

jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Link Checker
        id: lychee
        uses: lycheeverse/[email protected]
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

      - name: Create Issue From File
        if: steps.lychee.outputs.exit_code != 0
        uses: peter-evans/create-issue-from-file@v3
        with:
          title: Link Checker Report
          content-filepath: ./lychee/out.md
          labels: report, automated issue

Alternative approach:

This will check all repository links during any git push event and for all pull requests. If there's an error, it will fail the action. This has the benefit of ensuring that during a Pull Request, no link is added that is broken and any existing link will be caught if they become broken. Save this under .github/workflows/links-fail-fast.yml:

name: Links (Fail Fast)

on:
  push:
  pull_request:

jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Link Checker
        uses: lycheeverse/[email protected]
        with:
          fail: true
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Passing arguments

This action uses lychee for link checking. lychee arguments can be passed to the action via the args parameter. On top of that, some other inputs are supported: format, output, and fail.

- name: Link Checker
  uses: lycheeverse/[email protected]
  with:
    # Check all markdown and html files in repo (default)
    args: --verbose --no-progress './**/*.md' './**/*.html'
    # Use json as output format (instead of markdown)
    format: json
    # Use different output filename
    output: /tmp/foo.txt
    # Fail action on broken links
    fail: true

See lychee's documentation for all possible arguments.

Excluding links from getting checked

Add a .lycheeignore file to the root of your repository to exclude links from getting checked. It supports regular expressions. One expression per line.

Optional environment variables

Issues with links will be written to a file containing the error report. The default path is lychee/out.md. The path and filename may be overridden with the following variable:

  • LYCHEE_OUT - The path to the output file for the Markdown error report

Fancy badge

Pro tip: You can add a little badge to your repo to show the status of your links. Just replace org with your organisation name and repo with the repository name and put it into your README.md:

[![Check Links](https://github.com/org/repo/actions/workflows/links.yml/badge.svg)](https://github.com/org/repo/actions/workflows/links.yml)

It will look like this:

Check Links

Troubleshooting and common problems

See lychee's Troubleshooting Guide for solutions to common link-checking problems.

Performance

A full CI run to scan 576 links takes approximately 1 minute for the analysis-tools-dev/static-analysis repository.

Security and Updates

It is recommended to pin lychee-action to a fixed version for security reasons. You can use dependabot to automatically keep your Github actions up-to-date. This is a great way to pin lychee-action, while still receiving updates in the future. It's a relatively easy thing to do.

Create a file named .github/dependabot.yml with the following contents:

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: ".github/workflows"
    schedule:
      interval: "daily"

When you add or update the dependabot.yml file, this triggers an immediate check for version updates. Please see the documentation for all configuration options.

Security tip

For additional security when relying on automation to update actions you can pin the action to a SHA-256 rather than the semver version so as to avoid tag spoofing Dependabot will still be able to automatically update this.

For example:

- name: Link Checker
  uses: lycheeverse/lychee-action@cb79c9607b37671965f8dbb54cae47795758a440 #1.1.1
  #...

Credits

This action is based on peter-evans/link-checker and uses lychee (written in Rust) instead of liche (written in Go) for link checking. For a comparison of both tools, check out this comparison table.

License

lychee is licensed under either of

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].