Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: run respec workflow only on changes to relevant files #4495

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/respec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ name: respec
# on the gh-pages branch when the corresponding markdown files change.
#

# run this on push to main
# run this on push to main for spec-relevant files
on:
push:
branches:
- main
paths:
- 'versions/*.md'
- 'scripts/md2html/**'
- '.github/workflows/respec.yaml'
- 'package.json'
- 'package-lock.json'
workflow_dispatch: {}

jobs:
Expand Down
4 changes: 3 additions & 1 deletion scripts/md2html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ for specification in $specifications; do

node scripts/md2html/md2html.js --maintainers $maintainers $specification "$allVersions" > $tempfile
npx respec --no-sandbox --use-local --src $tempfile --out $tempfile2
Copy link
Contributor

@duncanbeevers duncanbeevers Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the TZ env var while running npx respec to ensure more-consistent output, regardless of where the workflow / script is run.

TZ=UTC npx respec …

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea. Did you test whether it has the desired effect for the fluctuating darkmode?

# remove unwanted Google Tag Manager and Google Analytics scripts
# remove unwanted Google Tag Manager and Google Analytics scripts, non-deterministic changes, and ReSpec minor version
sed -e 's/<script type="text\/javascript" async="" src="https:\/\/www.google-analytics.com\/analytics.js"><\/script>//' \
-e 's/<script type="text\/javascript" async="" src="https:\/\/www.googletagmanager.com\/gtag\/js?id=G-[^"]*"><\/script>//' \
-e 's/ toc-inline//' -e 's/ darkmode//' \
-e 's/"ReSpec \([0-9]*\)[.0-9]*"/"ReSpec \1"/' \
$tempfile2 > $destination

echo === Built $destination
Expand Down