-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (47 loc) · 1.56 KB
/
update-rolldown-stats.yml
File metadata and controls
58 lines (47 loc) · 1.56 KB
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
51
52
53
54
55
56
57
58
name: Update Rolldown Stats
on:
workflow_dispatch:
push:
branches:
- main
permissions: {}
jobs:
update-stats:
permissions:
contents: write
packages: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup vp
uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1.6.0
with:
cache: true
- name: Run rolldown stats collection
run: vp run generate
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Format data
run: vp check --fix
- name: Check for changes
id: git-check
run: |
if git diff --exit-code data/rolldown-version-stats.json; then
echo "No changes detected in rolldown-version-stats.json"
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected in rolldown-version-stats.json"
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "1430279+Boshen@users.noreply.github.com"
git config --local user.name "Boshen"
git add data/rolldown-version-stats.json
git commit -m "chore: update rolldown version stats"
git push origin main
- name: No changes to commit
if: steps.git-check.outputs.changes != 'true'
run: echo "No changes to commit"