Add secure AzerothAI host operations
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user