-
Notifications
You must be signed in to change notification settings - Fork 40
47 lines (38 loc) · 1.37 KB
/
content-validator.yaml
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
name: Drop content validator
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- canary
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.9.0
- name: Install dependencies
#run: npm install .github/content-validator
run: npm install node-fetch
- name: Get the Drop schema json
id: changed-files-specific
uses: tj-actions/changed-files@v44
- name: List changed JSON schema files
if: steps.changed-files-specific.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }}
run: |
echo "✅ Success - List all the files that have changed: $ALL_CHANGED_FILES"
- name : Check content
if: steps.changed-files-specific.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }}
run: |
## Get all the file paths that have changed and merged them into a single string
changed_files=$(echo "${ALL_CHANGED_FILES}" | tr '\n' ' ')
echo "Changed files: $changed_files"
node ./.github/content-validator/validator.js $changed_files