Make uWebSockets.js required for node-serve (#11311) #4460
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
| name: Format | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format: | |
| if: "${{ github.repository == 'remix-run/remix' && !startsWith(github.event.head_commit.message, 'chore: format') }}" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.FORMAT_PAT }} | |
| fetch-depth: 0 | |
| - name: Detect formatting-relevant changes | |
| id: changes | |
| run: | | |
| base="${{ github.event.before }}" | |
| if [ "$base" = "0000000000000000000000000000000000000000" ]; then | |
| files="$(git ls-files)" | |
| else | |
| files="$(git diff --name-only "$base" "$GITHUB_SHA")" | |
| fi | |
| if [ -z "$files" ]; then | |
| echo "No changed files detected" | |
| echo "should_run=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| while IFS= read -r file; do | |
| case "$file" in | |
| .prettierignore|.prettierrc|.prettierrc.json|.prettierrc.yml|.prettierrc.yaml|.prettierrc.js|.prettierrc.cjs|.prettierrc.mjs|*.js|*.jsx|*.cjs|*.mjs|*.ts|*.tsx|*.cts|*.mts|*.json|*.jsonc|*.md|*.mdx|*.yaml|*.yml|*.css|*.scss|*.html) | |
| echo "Formatting-relevant change: $file" | |
| echo "should_run=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| ;; | |
| esac | |
| done <<EOF | |
| $files | |
| EOF | |
| echo "No formatting-relevant files changed" | |
| echo "should_run=false" >> "$GITHUB_OUTPUT" | |
| - name: Install pnpm | |
| if: steps.changes.outputs.should_run == 'true' | |
| uses: pnpm/action-setup@v4 | |
| - name: Install Node.js | |
| if: steps.changes.outputs.should_run == 'true' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: 'package.json' | |
| cache: pnpm | |
| - name: Install dependencies | |
| if: steps.changes.outputs.should_run == 'true' | |
| run: pnpm install --frozen-lockfile | |
| - name: Format | |
| if: steps.changes.outputs.should_run == 'true' | |
| run: pnpm format | |
| - name: Commit | |
| if: steps.changes.outputs.should_run == 'true' | |
| run: | | |
| git config --local user.email "hello@remix.run" | |
| git config --local user.name "Remix Run Bot" | |
| git add . | |
| git restore .github/workflows # PAT doesn't have permission to push workflow changes | |
| if [ -z "$(git status --porcelain)" ]; then | |
| echo "No formatting changes" | |
| exit 0 | |
| fi | |
| git commit -m "chore: format" | |
| git push | |
| echo "Pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)" |