Skip to content

Find broken links

Find broken links #16

name: Find broken links
on:
schedule:
# 0: At the start of the minute (0th minute)
# 3: At 3 o'clock
# *: Every day of the month
# *: Every month
# 1: On Monday
- cron: '0 3 * * 1' # Every Monday at 3:00 AM
workflow_dispatch:
jobs:
findbrokenlinks:
name: Find broken links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19
cache: npm
- name: Install dependencies
run: npm ci
##############################
- name: Find broken links
env:
GITHUB_ISSUE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node maintenance/findBrokenLinks.js
# Since this GitHub Action is specifically designed to only handle the /logs/brokenLinks.md file and the runner environment is ephemeral, you can safely use this:
- name: Force push changes for /logs/brokenLinks.md
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./logs/brokenLinks.md # Using the full relative path from the root
# Check if there are changes in /logs/brokenLinks.md
git diff --cached --exit-code && exit 0 # Exit if no changes
# Commit and force push only /logs/brokenLinks.md
git commit -m "Update /logs/brokenLinks.md"
git push origin +HEAD:main
##############################
# ##############################
# - name: Build website
# run: npm run build
# ##############################
# ##############################
# # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# # https://github.com/WebOfTrust/WOT-terms/settings/secrets/actions, section “Repository secrets”, entry: “ACCESS_TOKEN”
# github_token: ${{ secrets.GITHUB_TOKEN }}
#
# # Build output to publish to the `gh-pages` branch:
# publish_dir: ./build
# # The following lines assign commit authorship to the official
# # GH-Actions bot for deploys to `gh-pages` branch:
# # https://github.com/actions/checkout/issues/13#issuecomment-724415212
# # The GH actions bot is used by default if you didn't specify the two fields.
# # You can swap them out with your own user credentials.
# user_name: github-actions[bot]
# user_email: 41898282+github-actions[bot]@users.noreply.github.com
# ##############################