Skip to content

Commit ef04f5f

Browse files
committed
Add script for verifying source code changes
Also use the new script in the check-pr.yml workflow.
1 parent d5afd6e commit ef04f5f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/check-pr.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ jobs:
5454
path: html/issue*.html
5555
retention-days: 7
5656
if-no-files-found: ignore
57+
58+
- name: Check source code changes
59+
continue-on-error: true
60+
run: |
61+
git fetch --depth 2 origin master
62+
if ! git diff --quiet origin/master HEAD -- src
63+
then
64+
if ! bin/check-html-diffs.sh origin/master always
65+
then
66+
echo "::warning title=html-diffs::Generated HTML files do not match"
67+
fi
68+
fi

bin/check-html-diffs.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
old=$(mktemp -d ./mailing.old.XXXXXX)
3+
new=$(mktemp -d ./mailing.new.XXXXXX)
4+
echo Building lists at HEAD
5+
make clean
6+
make lists -j4
7+
sed -i 's/Revised ....-..-.. at ..:..:.. UTC/Revised .../' mailing/*.html
8+
mv mailing $new
9+
git checkout ${1-origin/master} -- src
10+
echo Building lists with code from `git rev-parse origin/master`
11+
make clean
12+
make lists -j4
13+
git checkout HEAD -- src
14+
sed -i 's/Revised ....-..-.. at ..:..:.. UTC/Revised .../' mailing/*.html
15+
mv mailing $old
16+
diff -u -r --color=${2:-auto} $old $new || exit
17+
rm -r $old $new
18+
echo No changes to HTML files

0 commit comments

Comments
 (0)