Skip to content

Commit f085ef5

Browse files
Update workflows
1 parent 762eee7 commit f085ef5

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/check-snippets.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Checks snippets syntax
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'snippets/**'
7+
8+
jobs:
9+
check-snippets:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: "16"
20+
21+
- name: Check if snippets are formated correctly
22+
run: |
23+
node utils/checkSnippetFormatting.js # Run the script located in the utils/ folder

.github/workflows/consolidate-snippets.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Consolidate JSON Files
33
on:
44
push:
55
paths:
6-
- "public/data/**"
6+
- "snippets/**"
77

88
permissions:
99
contents: write
@@ -25,14 +25,19 @@ jobs:
2525
run: |
2626
npm install
2727
28-
- name: Consolidate JSON files
28+
- name: Consolidate Snippets into JSON files
2929
run: |
30-
node utils/consolidate.js # Run the script located in the utils/ folder
30+
node utils/consolidateSnippets.js # Run the script located in the utils/ folder
31+
32+
- name: Consolidate JSON files into merged file
33+
run: |
34+
node utils/consolidate.js
3135
3236
- name: Commit and push changes
3337
run: |
3438
git config --global user.name "GitHub Action"
3539
git config --global user.email "[email protected]"
40+
git add public/data/*
3641
git add public/consolidated/all_snippets.json
3742
git commit -m "Update consolidated snippets"
3843
git push

0 commit comments

Comments
 (0)