Skip to content

Commit 13073a9

Browse files
committed
Add CI script to pull-code-samples
1 parent 1cf5ffa commit 13073a9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pull Code Samples
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Runs on all branches
7+
8+
jobs:
9+
update-samples:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Run pull-code-samples script
26+
run: node scripts/pull-code-samples.js
27+
28+
- name: Commit changes
29+
run: |
30+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
31+
git config --local user.name "github-actions[bot]"
32+
git add snippets/
33+
git diff --quiet && git diff --staged --quiet || git commit -m "Update code samples [skip ci]"
34+
git push

0 commit comments

Comments
 (0)