diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index df8acfed10..1bbaeb69eb 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -54,3 +54,15 @@ jobs: path: html/issue*.html retention-days: 7 if-no-files-found: ignore + + - name: Check source code changes + continue-on-error: true + run: | + git fetch --depth 2 origin master + if ! git diff --quiet origin/master HEAD -- src + then + if ! bin/check-html-diffs.sh origin/master always + then + echo "::warning title=html-diffs::Generated HTML files do not match" + fi + fi diff --git a/bin/check-html-diffs.sh b/bin/check-html-diffs.sh new file mode 100755 index 0000000000..bc5f4f79c6 --- /dev/null +++ b/bin/check-html-diffs.sh @@ -0,0 +1,18 @@ +#!/bin/sh +old=$(mktemp -d ./mailing.old.XXXXXX) +new=$(mktemp -d ./mailing.new.XXXXXX) +echo Building lists at HEAD +make clean +make lists -j4 +sed -i 's/Revised ....-..-.. at ..:..:.. UTC/Revised .../' mailing/*.html +mv mailing $new +git checkout ${1-origin/master} -- src +echo Building lists with code from `git rev-parse origin/master` +make clean +make lists -j4 +git checkout HEAD -- src +sed -i 's/Revised ....-..-.. at ..:..:.. UTC/Revised .../' mailing/*.html +mv mailing $old +diff -u -r --color=${2:-auto} $old $new || exit +rm -r $old $new +echo No changes to HTML files