-
-
Notifications
You must be signed in to change notification settings - Fork 3
28 lines (28 loc) · 1.03 KB
/
test-html.yml
File metadata and controls
28 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Test HTML
on:
pull_request:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate index.html
uses: docker://pandoc/core:3.8.2.1@sha256:6c1440145aaa075bd9cee256343bb108d95dfe77cfaafa6475c88d1efd62c580
with:
args: >-
--standalone --template=template.html --output=index.html README.md
- name: Validate title tag
run: |
count_open=$(grep -o '<title>' index.html | wc -l)
count_close=$(grep -o '</title>' index.html | wc -l)
if [ "$count_open" -ne 1 ] || [ "$count_close" -ne 1 ]; then
echo "Expected exactly one <title> tag and one </title> tag, found $count_open and $count_close"
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