-
Notifications
You must be signed in to change notification settings - Fork 60
feat: add UI Build Artifacts Check workflow #1229
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b7875c5
feat: add UI Build Artifacts Check workflow
agiannelli-auth0 febf66f
chore: add npm version patch command to build script
agiannelli-auth0 7d5c344
chore: update build scripts to automatically bump patch version in pa…
agiannelli-auth0 9c61d88
chore: update build scripts to check for manual version changes befor…
agiannelli-auth0 798bb5c
chore: add missing shebang to copy-build.sh script
agiannelli-auth0 a51e5b7
chore: update CODEOWNERS
agiannelli-auth0 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
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,46 @@ | ||
| name: UI Build Artifacts Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| jobs: | ||
| ui-build-check: | ||
| name: UI Build Artifacts Check | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !github.event.pull_request.draft }} | ||
|
|
||
| steps: | ||
| - name: Check out repo | ||
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check ui artifacts are committed | ||
| run: | | ||
| BASE=${{ github.event.pull_request.base.sha }} | ||
| HEAD=${{ github.event.pull_request.head.sha }} | ||
| CHANGED=$(git diff --name-only "$BASE"..."$HEAD") | ||
|
|
||
| UI_SRC_CHANGED=$(echo "$CHANGED" | grep -cE '^ui/src/|^ui/package\.json' || true) | ||
| UI_ARTIFACT_CHANGED=$(echo "$CHANGED" | grep -cE '^main/ui/auth0-docs-ui-' || true) | ||
|
|
||
| UC_SRC_CHANGED=$(echo "$CHANGED" | grep -cE '^universal-components/src/|^universal-components/package\.json' || true) | ||
| UC_ARTIFACT_CHANGED=$(echo "$CHANGED" | grep -cE '^main/ui/universal-components/' || true) | ||
|
|
||
| FAILED=0 | ||
|
|
||
| if [ "$UI_SRC_CHANGED" -gt 0 ] && [ "$UI_ARTIFACT_CHANGED" -eq 0 ]; then | ||
| echo "::error::ui/src changes detected but main/ui/ artifacts were not updated." | ||
| echo "::error::Run: cd ui && npm run copy:build — then commit the updated files in main/ui/." | ||
| FAILED=1 | ||
| fi | ||
|
|
||
| if [ "$UC_SRC_CHANGED" -gt 0 ] && [ "$UC_ARTIFACT_CHANGED" -eq 0 ]; then | ||
| echo "::error::universal-components/src changes detected but main/ui/universal-components/ artifacts were not updated." | ||
| echo "::error::Run: cd universal-components && pnpm run copy:assets — then commit the updated files in main/ui/universal-components/." | ||
| FAILED=1 | ||
| fi | ||
|
|
||
| exit $FAILED |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Bump patch only if the version field hasn't been manually changed already | ||
| BASE_VER=$(git show HEAD:package.json | jq -r '.version') | ||
| CUR_VER=$(jq -r '.version' package.json) | ||
| if [ "$BASE_VER" = "$CUR_VER" ]; then | ||
| pnpm version patch --no-git-tag-version | ||
| fi | ||
| pnpm build | ||
| rm -f ../main/ui/* | ||
| cp -r dist/*.{js,css} ../main/ui/ |
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.