Skip to content

Commit ba9dcee

Browse files
authored
Merge pull request #25 from SigNoz/chore/component-sync-setup
feat: add SVGR sync workflow to regenerate and verify icon components
2 parents 1a0c77a + cd0b009 commit ba9dcee

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/svgr-sync.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: SVGR sync
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
paths:
7+
- "assets/**"
8+
- "svgr-template.js"
9+
- "index-template.cjs"
10+
- "package.json"
11+
12+
jobs:
13+
svgr-check:
14+
name: SVGR in sync
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 9
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: "20"
26+
cache: "pnpm"
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Generate icon components from SVGs
32+
run: pnpm run svgr
33+
34+
- name: Check components in sync with assets
35+
run: |
36+
if ! git diff --exit-code src; then
37+
echo "::error::Generated icon components are out of sync with assets."
38+
echo ""
39+
echo "Run the following locally, then commit and push:"
40+
echo " pnpm run svgr"
41+
echo ""
42+
git diff --stat src
43+
exit 1
44+
fi

0 commit comments

Comments
 (0)