Skip to content

Add closing title tag check to test workflow #10

Add closing title tag check to test workflow

Add closing title tag check to test workflow #10

Workflow file for this run

name: Test HTML
on:
pull_request:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Generate index.html
uses: docker://pandoc/core:3.1.1.0@sha256:ca7b3fbbb47d5438d8b0d51812bd1f10a8f6c3ab15e9bf68d0a7d93135bda721
with:
args: >-
--standalone --template=template.html --output=index.html README.md
- name: Validate title tag
run: |
count=$(grep -o '<title>' index.html | wc -l)
if [ "$count" -ne 1 ]; then
echo "Expected exactly one <title> tag, found $count"
exit 1
fi
close_count=$(grep -o '</title>' index.html | wc -l)
if [ "$close_count" -ne 1 ]; then
echo "Expected exactly one </title> tag, found $close_count"
exit 1
fi