Skip to content

🚨 | The only Github Action that will open pull request review when a broken link has been found in one of your markdown documentation.

License

Notifications You must be signed in to change notification settings

atalent-labs/404-links

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

404-links - Github Action

The only Github Action that will open pull request review when a broken link has been found in one of your markdown documentation.

Table of Contents

About

A part of a good developer experience is to ensure that the documentation is accurate. Since most of the repositories depend on different website to get additional detail. This Github action will support you to validate all the links includes in your documentation.

Apply the world in class link checker for your documentation

Example

Screen Recording 2566-01-22 at 10 44 15 PM-min (1)

Summary

image

Creation of Pull Request Review

Example

Versions

Github Action

If you want to use the script on github action:

  1. Create a new file in your repository : .github/workflows/markdown-lint.yml
  2. Copy paste the informations in your .github/workflows/markdown-lint.yml:
name: Markdown lint

on:
  push:
    branches: [ master ]
  pull_request:
    types: [assigned, opened, synchronize, reopened]

jobs:
  check-links:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: 'restqa-404-links'
      uses: restqa/404-links@3.1.4
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Customize the linting

In order to customize the linter, you will need to create a .404-links.yml configuration file at the root level of your project. Then you can add the following options into the file:

folder: docs/ # The folder that required to be parsed
httpsOnly: true # If you want enforce only HTTPS links
pullRequestReview: true # If you want a nice review in your pull requests
ignore: 
  urls: # Array of url to ignore
    - https://github.com 
    - https://broken/* # wildcard allows
  files: # Array of markdown file the shouldn't parse
    - ./test.md # Relative path from the folder shared above
delay:
  'https://gitlab.com': 500 # Perform a pause of 500ms at each call matching the url

Options

property required type. description Default
folder No string The folder that need to be parsed by the github action .
httpsOnly No boolean Define all the links SHOULD be HTTPS false
pullRequestReview No boolean Activate the pull request review creation when error are found true
ignore.urls No array List of url to ignore
ignore.files No array List of file to ignore during the scanning
delay. No object Delay to apply on a domain to avoid rate limits

Contribution Development

In order to run the code locally you can

  • Install the dependencies: npm i
  • Run the test npm test

Author

License

MIT License

References

Keywords

  • test automation
  • Gherkin
  • Cucumber
  • End to End
  • E2E
  • Quality assurance
  • QA
  • Continuous integration
  • RestQa

License

MIT License

About

🚨 | The only Github Action that will open pull request review when a broken link has been found in one of your markdown documentation.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks