Skip to content

Commit

Permalink
Add npm package diff for rendered HTML changes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Dec 1, 2023
1 parent e8da765 commit 9ed11f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/diff-change-to-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ jobs:
markerText: '<!-- package/nunjucks.diff -->',
skipEmpty: true
},
{
path: '${{ github.workspace }}/.cache/diff/package/html.diff',
titleText: 'Rendered HTML changes to npm package',
markerText: '<!-- package/html.diff -->',
skipEmpty: true
},
{
path: '${{ github.workspace }}/.cache/diff/package/other.diff',
titleText: 'Other changes to npm package',
Expand Down
5 changes: 5 additions & 0 deletions bin/package-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ git diff HEAD^ -- packages/govuk-frontend/dist/govuk/govuk-frontend.min.css \
git diff -M05 HEAD^ -- "packages/govuk-frontend/dist/**/*.njk" \
> $output_folder/.cache/diff/package/nunjucks.diff

# Diff the rendered HTML output
git diff -M05 HEAD^ -- "packages/govuk-frontend/dist/**/*.html" \
> $output_folder/.cache/diff/package/html.diff

# Diff the rest of the files, excluding the sourcemaps and the minified files
git diff -M05 HEAD^ -- packages/govuk-frontend/dist \
":(exclude)**/*.html" \
":(exclude)**/*.map" \
":(exclude)**/*.min.*" \
":(exclude)**/*.njk" \
Expand Down

0 comments on commit 9ed11f6

Please sign in to comment.