Awesome URL validation with Github Actions

Jeroen • September 23, 2019

Since a couple of days me and my coworkers maintain a Awesome List about anything we think others should check out, ranging from coding practices to Firefox addons. And since not that long ago, Github provides its own CI/CD workflows with Github Actions. We decided to use those together with a bot to make sure we do not have any dead links in our awesome list.

The bot we used is called awesome_bot and despite the name or the description, it can be used in any project to check for dead links, not just Awesome Lists. The bot is written in ruby, and the creator also documented on how to use the bot through a docker container, which is what we used for our Github Action.

The most up-to-date workflow for our validator can be found in the repository. Here's a breakdown:

name: CI

on:
  pull_request:
    branches:
    - master

This part gives the workflow a name, and determines on which events and branches it should trigger. In this case, only on pull requests on the master branch.

jobs:
  test:
    name: awesome_bot verification
    runs-on: ubuntu-latest

    steps:
      - name: Checkout project
        uses: actions/checkout@v1
      - name: Run awesome_bot
        uses: docker://dkhamsing/awesome_bot:latest
        with:
          args: README.md

The workflow only contains one job, the test called 'awesome_bot verification`. Github allows you to run the job on any OS you like, we choose to use the latest Ubuntu. Next, the two steps of the job are defined. First, the code of the repository (or pull request) is checked out. Then the docker image of the awesome_bot URL validator is downloaded and executed on the README.me file.

Interested in how it runs? Check out one of the first PRs.