-
Notifications
You must be signed in to change notification settings - Fork 28
50 lines (42 loc) · 1.52 KB
/
bundle-impact.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Bundle Impact
on:
pull_request_target:
branches: [main, next]
types: [opened, synchronize]
jobs:
bundle-impact:
name: Calculate Bundle Impact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Pull Request
id: checkout
env:
PR_REPO_URL: https://github.com/${{ github.event.pull_request.head.repo.owner }}/${{ github.event.pull_request.head.repo.name }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
bash scripts/checkout-pr.sh src
if [ -z "$(git status --porcelain)" ]; then
echo '::set-output name=has_changes::false'
else
echo '::set-output name=has_changes::true'
fi
- name: Install pnpm
if: steps.checkout.outputs.has_changes == 'true'
uses: pnpm/action-setup@v4
- name: Install Node.js
if: steps.checkout.outputs.has_changes == 'true'
uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install dependencies
if: steps.checkout.outputs.has_changes == 'true'
run: |
pnpm install -C scripts/bundle-impact
- name: Run Bundle Impact
if: steps.checkout.outputs.has_changes == 'true'
env:
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
TARGET_BRANCH: ${{ github.base_ref }}
run: |
./scripts/bundle-impact/node_modules/.bin/tsx ./scripts/bundle-impact/pr-bundle-impact.ts ${{ github.event.number }}