Files

46 lines
992 B
YAML

name: AzerothAI Host Operations
on:
workflow_dispatch:
inputs:
operation:
description: Approved AzerothAI operation
required: true
default: status
jobs:
azeroth:
runs-on: azerothai-host
timeout-minutes: 60
env:
AZEROTH_OPERATION: ${{ inputs.operation }}
AZEROTH_ACTOR: ${{ gitea.actor }}
AZEROTH_REPOSITORY: ${{ gitea.repository }}
steps:
- name: Verify authorized request
shell: bash
run: |
set -euo pipefail
if [ "$AZEROTH_REPOSITORY" != "richard/AzerothAI" ]; then
echo "Rejected repository: $AZEROTH_REPOSITORY"
exit 1
fi
if [ "$AZEROTH_ACTOR" != "richard" ]; then
echo "Rejected actor: $AZEROTH_ACTOR"
exit 1
fi
- name: Execute approved operation
shell: bash
run: |
set -euo pipefail
sudo -n /usr/local/bin/azerothai-ops "$AZEROTH_OPERATION"