Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

awesome_bot

> DevOps
Open source

:white_check_mark: Validate links in awesome projects

893 stars0 likes3 views
WebsiteGitHub

About

:white_check_mark: Validate links in awesome projects

awesome_bot

Verify links in awesome projects

awesome_bot checks for valid URLs in a file, it can be used to verify pull requests updating a README.

Installation

$ gem install awesome_bot

Usage

Command Line

…
  • You can check multiple files (comma separated or * pattern, look below for details).

  • By default, duplicate URLs or any status code other than 200 are flagged as failures.

    • Use option --allow-dupe to allow duplicates.
    • Use option --allow-redirect to allow redirects.
    • Use option --allow to allow specific status code errors.
    • Use option --white-list (-w for short) to prevent links from being flagged: -w domain1.com/post/article,domain2.com white lists domain1.com/post/article and all links matching domain2.com.

Examples

…
…
…

Docker Examples

If you do not want to install Ruby or its dependencies you can simply use Docker and Docker image.

Here is an example for checking the links in the Markdown files in your current directory/subdirectories:

bash
docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "test.com" --allow-dupe --allow-redirect --skip-save-results `find . -name "*.md"`

or just check the links in a single file located at ./templates/ubuntu.md:

bash
docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --allow-dupe --allow-redirect --skip-save-results ./templates/ubuntu.md

You always need to specify the path to the file so you cannot simply use *.md; instead use ls *.md":

bash
docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "test.com" --allow-dupe --allow-redirect --skip-save-results `ls *.md`

Library

ruby
irb(main):001:0> require 'awesome_bot'
=> true
irb(main):002:0> content = File.read 'README.md'
=> "..."
irb(main):003:0> result = AwesomeBot.check content
=> #
# AwesomeBot Result with success, statuses_issues, dupes and more
irb(main):004:0> puts result.success ? 'No errors' : ':-('
:-(

More information at rubydoc.

Validate Pull Requests

Does your GitHub README contain a lot of links? awesome_bot can help you validate them when a pull request is created (or a commit is pushed). It is used by:

  • https://github.com/tiimgreen/github-cheat-sheet
  • https://github.com/enaqx/awesome-react
  • https://github.com/ziadoz/awesome-php
  • https://github.com/vsouza/awesome-ios
  • https://github.com/alebcay/awesome-shell
  • https://github.com/matteocrippa/awesome-swift

and more.

Tips

  • Use the keyword [ci skip] in your commit title/message to skip verification.
  • Use Danger.

GitHub Actions

To use awesome_bot with GitHub Actions (workflows), here is an example:

yaml
name: Ruby

on:
  push:
    branches: [ '*' ]
  pull_request:
    branches: [ '*' ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby 2.6
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: '2.6'
    - name: Checks
      run: |
        gem install awesome_bot
        awesome_bot check-unique.txt --allow-ssl -a 302,429 -w xbmc/xbmc

Travis CI

To use awesome_bot with Travis CI, connect your repo and create a .travis.yml file.

yaml
language: ruby
rvm: 2.4.1
before_script: gem install awesome_bot
script: awesome_bot README.md

To turn off email notifications, add the lines below

yaml
notifications:
  email: false

In case you want to use the docker image inside Travis CI follow this example which will check broken links in all *.md files in your repository:

yaml
sudo: required

services:
  - docker

script:
  # Link Checks
  - docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --allow-dupe --allow-redirect --skip-save-results `find . -name "*.md"`

More

CircleCI, Codeship, and Semaphore CI support running tests without adding a file to the repo (a public configuration file can however help others contribute).

# Codeship
Setup
rvm use 2.4.1 --install
gem install awesome_bot

Test
awesome_bot README.md
# Semaphore CI
Language: Ruby
Ruby version: 2.4.1
Databases for: don't generate
Setup:
gem install awesome_bot
awesome_bot README.md

Status Badge

To add the Travis CI build status badge above to your project, use the following code

i.e.

As it happens, the default code snippet provided contains a redirect so adding a badge could fail your status :sob:.. one way to fix this is to white list travis-ci, i.e.

- awesome_bot README.md --white-list travis-ci

You can also add a badge for other CI tools, check out .

Danger

Integrate awesome_bot with Danger and have results reported back to the pull request.

Here's the step in your Dangerfile:

ruby
# Check links
require 'json'
results = File.read 'ab-results-README.md-markdown-table.json'
j = JSON.parse results
if j['error']==true
  fail j['title']
  markdown j['message']
end

Contact

  • github.com/dkhamsing
  • twitter.com/dkhamsing

License

This project is available under the MIT license. See the LICENSE file for more info.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubyawesomecicirclecicli

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理