forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.6 KB
/
services-json.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Services Validator
on:
push:
paths:
- "plugins/rtmp-services/data/services.json"
- "plugins/rtmp-services/data/package.json"
pull_request:
paths:
- "plugins/rtmp-services/data/services.json"
- "plugins/rtmp-services/data/package.json"
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
schema:
name: Schema
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install & Configure Python
run: |
sudo apt install python3.9-dev
python3.9 -m pip install jsonschema json_source_map
- name: Validate Service JSON Schema
run: |
JSON_FILES=(
plugins/rtmp-services/data/services.json
plugins/rtmp-services/data/package.json
)
python3.9 CI/check-jsonschema.py "${JSON_FILES[@]}"
- name: Annotate Errors
if: failure()
uses: yuzutech/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
title: "Service JSON Errors"
input: "./validation_errors.json"
service_check:
name: Service Check
runs-on: ubuntu-20.04
needs: schema
if: ${{ github.repository_owner == 'obsproject' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restore cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/other
key: service-check
- name: Install & Configure Python
run: |
sudo apt install python3.9
python3.9 -m pip install requests
- name: Check Services
id: check
run: python3.9 -u CI/check-services.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
REPOSITORY: ${{ github.repository }}
- uses: actions/upload-artifact@v3
with:
name: timestamps
path: ${{ github.workspace }}/other/*
- name: Create Pull Request
uses: peter-evans/create-pull-request@f094b77505fb89581e68a1163fbd2fffece39da1
if: steps.check.outputs.make_pr == 'true'
with:
author: "Service Checker <[email protected]>"
commit-message: "rtmp-services: Remove defunct servers/services"
title: "rtmp-services: Remove defunct servers/services"
branch: "automated/clean-services"
body: ${{ fromJSON(steps.check.outputs.pr_message) }}
delete-branch: true