CI: Add services check job
This commit is contained in:
57
.github/workflows/services-json.yml
vendored
57
.github/workflows/services-json.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
paths:
|
||||
- "plugins/rtmp-services/data/services.json"
|
||||
- "plugins/rtmp-services/data/package.json"
|
||||
schedule:
|
||||
- cron: 0 0 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
schema:
|
||||
@@ -38,3 +41,57 @@ jobs:
|
||||
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
|
||||
# if there are changes, run the PR step
|
||||
if ! git diff --quiet; then
|
||||
echo "::set-output name=make_pr::true"
|
||||
else
|
||||
echo "::set-output name=make_pr::false"
|
||||
fi
|
||||
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 <commits@obsproject.com>"
|
||||
commit-message: "rtmp-services: Remove defunct servers/services"
|
||||
title: "rtmp-services: Remove defunct servers/services"
|
||||
branch: "automated/clean-services"
|
||||
body: "Automatic PR to remove dead servers\nCreated by workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
delete-branch: true
|
||||
|
Reference in New Issue
Block a user