-
Notifications
You must be signed in to change notification settings - Fork 25
48 lines (41 loc) · 1.38 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
name: Bundle Impact
on:
pull_request_target:
branches: [main, next]
types: [opened, synchronize]
jobs:
bundle-impact:
name: Calculate Bundle Impact
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: Checkout Pull Request
id: checkout
env:
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
git remote add pr $PR_REPO_URL
git fetch pr "$PR_HEAD_REF"
git checkout "pr/$PR_HEAD_REF" -- 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: Run Bundle Impact
if: steps.checkout.outputs.has_changes == 'true'
env:
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
TARGET_BRANCH: ${{ github.base_ref }}
run: |
node scripts/run bundle-impact ${{ github.event.number }}