Skip to content

Check all URLs

Check all URLs #124

Workflow file for this run

# Name of workflow
name: Check all URLs
# Run workflow once a week
on:
workflow_dispatch:
schedule:
- cron: '15 1 * * 1'
# Steps to carry out
jobs:
build:
# Create a ubuntu virtual machine
runs-on: ubuntu-latest
# Checkout repo code
steps:
- name: Checkout repo
uses: actions/checkout@v2
# Install node
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 10.16
- run: npm install
- run: npm run build --if-present
- run: npm test
env:
CI: true
# Run script checkURLsinMarkdown.js
# Show the results
- name: Check URLs
run: |-
node checkURLsInMarkdown.js
echo "::set-output name=errors::$(grep '^\[ERROR' urlCheck.txt |wc -l)"
echo "::set-output name=codes404::$(grep '^\[404' urlCheck.txt |wc -l)"
id: check
# Make the output file available as an artifact
- name: Uploading artifact
uses: actions/upload-artifact@v2
with:
name: urlCheck
path: urlCheck.txt
# Create an issue with the number of errors found
- name: Create an issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ERRORS: ${{ steps.check.outputs.errors }}
CODES404: ${{ steps.check.outputs.codes404 }}
with:
filename: .github/checkURL-template.md