-
Notifications
You must be signed in to change notification settings - Fork 65
DEV-180: Resolve drift between example source files and generated index.js #569
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
Merged
tonyboylehub
merged 1 commit into
main
from
tonyboyle/dev-180-resolve-drift-between-example-source-files-and-generated
Sep 25, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Examples drift | ||
|
|
||
| # Fails when a src/examples/**/index.js is out of sync with the native | ||
| # source files (kit.js, umi.js, cli.sh, etc.) it's generated from, so a | ||
| # hand-edited source can no longer drift silently from the published docs. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'src/examples/**' | ||
| - 'scripts/build-examples.js' | ||
| - 'package.json' | ||
| - '.github/workflows/examples-drift.yml' | ||
| push: | ||
| branches: [main] | ||
|
|
||
| # This job checks out and installs pull-request-controlled code, so it gets no | ||
| # more than read access and never keeps the checkout token on disk. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Actions are pinned to commit SHAs; a tag can be moved, a SHA cannot. | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: pnpm | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm run build-examples | ||
|
|
||
| - name: Fail if build-examples produced a diff | ||
| run: | | ||
| if ! git diff --quiet -- src/examples; then | ||
| echo "::error::src/examples/**/index.js is out of sync with its source files. Run 'pnpm run build-examples' locally and commit the result." | ||
| git diff --stat -- src/examples | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.