Skip to content

Autopilot Operator #2181

Autopilot Operator

Autopilot Operator #2181

name: Autopilot Operator
on:
schedule:
- cron: "*/10 * * * *"
workflow_dispatch:
permissions:
contents: read
issues: write
pull-requests: write
jobs:
operator:
runs-on: [self-hosted, Windows]
env:
ORG: ${{ vars.ORG }}
GH_TOKEN: ${{ secrets.ORG_AUTOPILOT_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Ensure Codex on PATH
shell: pwsh
run: |
$codexPath = "C:\Program Files\codex"
if (Test-Path $codexPath) {
"PATH=$codexPath;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Checkout
uses: actions/checkout@v6
with:
clean: false
- name: Tool checks
shell: pwsh
run: |
git --version
gh --version
if (Get-Command codex -ErrorAction SilentlyContinue) {
codex --version
} else {
Write-Host "Codex not found on PATH"
exit 1
}
- name: Validate org mutation token
shell: pwsh
run: |
if (-not $env:GH_TOKEN) {
Write-Host "ORG_AUTOPILOT_TOKEN is not set."
exit 1
}
- name: Validate Codex auth
shell: pwsh
run: |
if (-not $env:OPENAI_API_KEY) {
Write-Host "OPENAI_API_KEY is not set."
exit 1
}
- name: Run operator
shell: pwsh
run: .\scripts\autopilot-operator.ps1