deps(backend)(deps): Bump express-rate-limit from 7.5.1 to 8.1.0 in /backend #13
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: Pull Request | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/labeler@v4 | |
| with: | |
| repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
| size: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check PR size | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const additions = pr.additions; | |
| const deletions = pr.deletions; | |
| const total = additions + deletions; | |
| let label = ''; | |
| if (total < 10) label = 'size/XS'; | |
| else if (total < 50) label = 'size/S'; | |
| else if (total < 200) label = 'size/M'; | |
| else if (total < 500) label = 'size/L'; | |
| else label = 'size/XL'; | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| labels: [label] | |
| }); | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run linter | |
| run: pnpm run lint | |
| - name: Run type checking | |
| run: pnpm run typecheck | |
| - name: Check formatting | |
| run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,md}" | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm run build:packages | |
| - name: Run tests | |
| run: pnpm run test:packages -- --coverage | |
| - name: Upload coverage | |
| if: matrix.node-version == '20' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: unittests | |
| name: pr-coverage | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build all packages | |
| run: pnpm run build:packages | |
| - name: Build backend | |
| run: pnpm run build:backend | |
| - name: Build frontend | |
| run: pnpm run build:frontend | |
| - name: Check bundle size | |
| run: | | |
| echo "Frontend bundle size:" | |
| du -sh frontend/dist | |
| echo "Backend bundle size:" | |
| du -sh backend/dist | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run security audit | |
| run: pnpm audit --audit-level=high | |
| continue-on-error: true | |
| - name: Check for secrets | |
| uses: trufflesecurity/trufflehog@main | |
| with: | |
| path: ./ | |
| base: ${{ github.event.pull_request.base.sha }} | |
| head: ${{ github.event.pull_request.head.sha }} | |
| preview: | |
| runs-on: ubuntu-latest | |
| needs: [quality, test, build] | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm run build:packages | |
| - name: Build frontend for preview | |
| run: pnpm run build:frontend | |
| env: | |
| VITE_API_URL: ${{ secrets.PREVIEW_API_URL }} | |
| - name: Deploy preview to Vercel | |
| id: vercel | |
| uses: amondnet/vercel-action@v25 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| working-directory: ./frontend | |
| alias-domains: pr-{{PR_NUMBER}}.cryptobot-preview.vercel.app | |
| - name: Comment PR with preview URL | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `🚀 Preview deployed to: ${process.env.VERCEL_URL}` | |
| }) | |
| env: | |
| VERCEL_URL: ${{ steps.vercel.outputs.preview-url }} |