fix: merge event on target branch #80
Workflow file for this run
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: Build | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Allow commenting on commits | |
| contents: write | |
| # Allow commenting on issues | |
| issues: write | |
| # Allow commenting on pull requests | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Pnpm | |
| run: | | |
| npm install -g corepack@latest --force | |
| corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| # Update npm to the latest version to enable OIDC | |
| - name: Update npm | |
| run: | | |
| npm install -g npm@latest | |
| npm --version | |
| node --version | |
| npx -v | |
| - name: Install Dependencies and Build | |
| run: | | |
| pnpm install --ignore-scripts | |
| pnpm run build | |
| - name: Run Tests | |
| run: | | |
| pnpm run test | |
| - name: Build Demo Project | |
| run: | | |
| cd examples/rsbuild-demo | |
| pnpm install | |
| pnpm run build | |
| cd ../rsbuild-demo2 | |
| pnpm run build | |
| - name: Report Compressed Size | |
| uses: ./ | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| file_path: 'examples/**/*/.rsdoctor/rsdoctor-data.json' | |
| target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }} |