Skip to content

nagios_update

nagios_update #368

Workflow file for this run

name: Update Status
on:
repository_dispatch:
types: [nagios_update]
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v7
with:
path: main
- name: Checkout gh-pages
uses: actions/checkout@v7
with:
ref: gh-pages
path: gh-pages
- name: Process Update
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# WICHTIG: Hier muss der Typ aus dem Dispatch-Payload übernommen werden
PAYLOAD: ${{ toJson(github.event.client_payload) }}
STATUS_DIR: gh-pages/status
CONFIG_JSON_PATH: main/config.json
run: |
python3 main/scripts/process_update.py
- name: Commit and Push
run: |
cd gh-pages
git config user.name "GitHub Action"
git config user.email "action@github.com"
git add status/*.json
git diff --quiet && git diff --staged --quiet || git commit -m "Update status for ${{ github.event.client_payload.host }}"
git push