# AWOOOI Gitea Onboarding Warning Step template.
#
# Controlled runtime:
# - no push / pull_request / pull_request_target trigger
# - no generic runner labels
# - runtime warning-step job is enabled for controlled workflow_dispatch only
# - no secrets, host writes, workflow dispatch from this commit, or product writes

name: AWOOOI Onboarding Warning Step

on:
  workflow_dispatch:

env:
  AWOOOI_ONBOARDING_WARNING_STEP_EXECUTION_ENABLED: "1"

jobs:
  workflow-shape:
    # Gitea 1.25 can mark a workflow invalid when every root job has a job-level
    # `if`. Keep this no-op root job so the workflow remains parseable while
    # the runtime warning-step job below stays behind the controlled switch.
    runs-on: awoooi-non110-host
    timeout-minutes: 1
    steps:
      - name: Confirm controlled warning-step workflow shape
        run: echo "warning-step runtime job is enabled for controlled workflow_dispatch only."

  warning-step:
    if: ${{ env.AWOOOI_ONBOARDING_WARNING_STEP_EXECUTION_ENABLED == '1' }}
    runs-on: awoooi-non110-host
    timeout-minutes: 3
    steps:
      - uses: actions/checkout@v4

      - name: Validate warning-step boundaries
        run: |
          set -euo pipefail
          python3 ops/runner/guard-gitea-runner-pressure.py --root .
          git diff --check
          cat <<'SUMMARY'
          AWOOOI onboarding warning step template is present.
          Runtime execution is enabled only for controlled workflow_dispatch boundary validation.
          SUMMARY
