-
Notifications
You must be signed in to change notification settings - Fork 15
54 lines (45 loc) · 1.43 KB
/
validate-and-build-index.yml
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
name: Validate & build index
on:
push:
branches:
- master
paths-ignore:
- 'mappings/index.json'
workflow_dispatch:
jobs:
servers:
runs-on: ubuntu-latest
steps:
# Prepare the working dir
- name: Clear any existing files
run: rm -rf *
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
# Install Python
- name: Setup Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Python dependencies
run: pip install -r mappings/scripts/requirements.txt
# Validate servers
- name: Validate Servers
run: |
cd mappings
python scripts/validate.py --servers_dir servers --metadata_schema metadata.schema.json --inactive_file inactive.json --inactive_schema inactive.schema.json
env:
PR_ID: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_ARGS: "true"
# Build index
- name: Delete the old index
run: rm -f mappings/index.json
- name: Build Index
run: |
cd mappings
python scripts/create_index.py --servers_dir servers --inactive_file inactive.json --index_output index.json
- name: Commit index
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Updated the servers index