Skip to content
Latchkey

Link Checker workflow (treasure-data/treasure-boxes)

The Link Checker workflow from treasure-data/treasure-boxes, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get caching, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: treasure-data/treasure-boxes.github/workflows/LinkChecker.ymlLicense MITView source

What it does

This is the Link Checker workflow from the treasure-data/treasure-boxes repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Link Checker

on: 
  schedule:
    # Run on 1st day of every month
    - cron: '0 0 1 * *'
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'     
        required: true
        default: 'warning'
      tags:
        description: 'Test scenario tags'  

jobs:
  # Set the job key. The key is displayed as the job name
  # when a job name is not provided
  boxes-checker:
    name: Treasure Boxes Link Checker
    runs-on: ubuntu-latest
    continue-on-error: true
    steps: 
      - name: Setup Environment
        uses: actions/setup-python@v5
        with:
          python-version: '3.8'
      - run: pip3 install git+https://github.com/linkchecker/linkchecker.git
      - run: mkdir ./logs

      - name: Check Links
        run: '(linkchecker -t 100 -o html http://boxes.treasuredata.com > ./logs/boxes.treasuredata.com.html) || true'
        continue-on-error: true

      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: boxes.treasuredata.com.html
          path: ./logs/boxes.treasuredata.com.html


      - name: Slack Notification
        uses: rtCamp/action-slack-notify@v2
        if: ${{ failure() }}
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
          SLACK_CHANNEL: project-treasure_box
          SLACK_USERNAME: CI_Bot
          SLACK_TITLE: Link Check of boxes.treasuredata.com
          MSG_MINIMAL: true
          SLACK_ICON_EMOJI: ':failed:'
          SLACK_MESSAGE: 'Monthly link check: broken links detected on boxes.treasuredata.com. Please see report artifact on https://github.com/treasure-data/treasure-boxes/actions/workflows/linkchecker.yml'
          SLACK_FOOTER: Powered by the Evangelism Team - Austin Blackstone
          SLACK_COLOR: '#E10600'

The same workflow, on Latchkey

Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.

name: Link Checker
 
on: 
  schedule:
    # Run on 1st day of every month
    - cron: '0 0 1 * *'
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'     
        required: true
        default: 'warning'
      tags:
        description: 'Test scenario tags'  
 
jobs:
  # Set the job key. The key is displayed as the job name
  # when a job name is not provided
  boxes-checker:
    timeout-minutes: 30
    name: Treasure Boxes Link Checker
    runs-on: latchkey-small
    continue-on-error: true
    steps: 
      - name: Setup Environment
        uses: actions/setup-python@v5
        with:
          cache: 'pip'
          python-version: '3.8'
      - run: pip3 install git+https://github.com/linkchecker/linkchecker.git
      - run: mkdir ./logs
 
      - name: Check Links
        run: '(linkchecker -t 100 -o html http://boxes.treasuredata.com > ./logs/boxes.treasuredata.com.html) || true'
        continue-on-error: true
 
      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: boxes.treasuredata.com.html
          path: ./logs/boxes.treasuredata.com.html
 
 
      - name: Slack Notification
        uses: rtCamp/action-slack-notify@v2
        if: ${{ failure() }}
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
          SLACK_CHANNEL: project-treasure_box
          SLACK_USERNAME: CI_Bot
          SLACK_TITLE: Link Check of boxes.treasuredata.com
          MSG_MINIMAL: true
          SLACK_ICON_EMOJI: ':failed:'
          SLACK_MESSAGE: 'Monthly link check: broken links detected on boxes.treasuredata.com. Please see report artifact on https://github.com/treasure-data/treasure-boxes/actions/workflows/linkchecker.yml'
          SLACK_FOOTER: Powered by the Evangelism Team - Austin Blackstone
          SLACK_COLOR: '#E10600'
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow